function iframeHeight() { var newHeight = $(window).height(); var newWidth = $(window).width(); var buffer = 100; // space required for any other elements on the page var newIframeHeight = newHeight - buffer;
$('iframe.fop').css('height',newIframeHeight).css('width',newWidth); //this will aply to all iframes on the page, so you may want to make your jquery selector more specific. }
// When DOM ready $(function() { window.onresize = iframeHeight; iframeHeight(); });