[ZT]Use JQuery to adjust the iframe height

Although frame is generally not recommended _disibledevent=>it might be possible, it is definitely not a clean implementation, and it is not supported by most of the browsers. In this case, iFrame may be a good alternative. The inner frame page will handle the multi-part form and the parent page will have the similar Ajax effect. That being said, iFrame’s biggest problem is that its width and height are set right from the start and it won’t adjust based _disibledevent=>< type=”text/javascript”>
$(document).ready(function() {
var theFrame = $(“#iFrameToAdjust”, parent.document.body);
theFrame.height($(document.body).height() + 30);
});


The JavaScript will get the iframe object from the parent DOM and change its height according to the size of the current document after the document is loaded (very important to get the true size). I like it because it is less intrusive to the page where the iframe is _disibledevent=>http://www.phinesolutions.com/use-jquery-to-adjust-the-iframe-height.html
Tags: 

延伸阅读

最新评论

发表评论