Skip to content

Instantly share code, notes, and snippets.

@return1
Created November 7, 2012 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save return1/4032581 to your computer and use it in GitHub Desktop.
Save return1/4032581 to your computer and use it in GitHub Desktop.
resize ad iframes by its content (ugly)
//auto-resizing ad-banners
var resizeInterval = window.setInterval(function () {
$iframe = $('#bigbanner iframe');
$iframe.attr('width', '100%').attr('height', '100%'); //reset
$doc = $($iframe.get(0).contentWindow.document);
$iframe.attr('width', $doc.width()).attr('height', $doc.height());
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment