Unobtrusive iFrame with JQuery

So, I figured, what a great way to do an iframe, too. Something like:

<a href="myiframe.html" class="iframe">Iframe Content</a>

I passed along the idea to my programming genius, Vlada and he came up with a great jquery iframe plugin by modifying malsup’s swf plugin.

<a href="http://33rockers.com" class="iframe w:700 h:300" >Iframe Content</a>

makes this…

<div class=iframe><iframe id=content_iframe marginWidth=0 marginHeight=0 src="https://33rockers.com/" frameBorder=0 width=640 height=480></iframe></div>

You can also set the defaults in jquery_iframe.js and just use
<a href="http://33rockers.com" class="iframe" >Iframe Content</a>

If javascript is turned off, it will just show a link to the content.

Here is the code in action and u can download the source code here.

References: malsup’s media plugins