
Untitled
By: a guest on
May 1st, 2012 | syntax:
None | size: 0.60 KB | hits: 14 | expires: Never
Why does the content height of my <iframe> keep increasing?
$("#iFrame").load(function () { resizeIframe(); }); // on load resize is called
loadIFrame(url); //this loads url in i frame
function resizeIframe() {
var iFHeight = $('iFrame').contents().height();
var iFWidth = $('iFrame').contents().width();
$("#content").css("height", iFHeight);
$("#content").css("width", iFWidth);
}
$('iframe').load(function(){
var $body = $(this).contents().find('body');
$("#content").css({
height: $body.height(),
width: $body.width()
});
})
.attr('src', 'iframeUrlHere');