Here’s another lunchtime jQuery snippet as the last one proved semi-popular. This one came about today as I needed to expand on an existing expand/collapse functionality to allow users to expand or collapse all of the objects with this functionality.
» Read the rest of the entry..
Category: Programming
Here’s a quick lunch time post to share a simple snippet.
It’s no new technology to have a page break out of frames when they’re not supposed to be in frames. But what if you do want the page to appear in a frame and only break the frame if a link is clicked? Well then we turn to our trusty jQuery and use this little code snippet:
-
if (top.frames.length != 0) {
-
$("a").click(function(){
-
this.target = "_parent";
-
});
-
}
Why would you want to do this? That’s a fair question. For one of our clients at work they embed the header from their site onto the page for a site which sells merchandise for them. Now, we could have created a separate header but then when the header gets updated it needs to be changed in two places. This way it’s just one header file to maintain.
Hopefully this saves other developers ten minutes of their lives.
I'm Patrick Jarrett. I am a Senior Software Developer for 
