开发者

constantly resizing iframe to contents via Jquery

if found this solution on the web that re-sizes the iFrame on load. I was wondering how I can do this by setting an loop that constantly chec开发者_开发知识库k's the active iframe's content size then resize it instantly

any ideas on how to do this on Jquery? Thanks!


You could try putting the code which changes the size of the iframe within the iframe page. When the iframe page loads, it can use jQuery to search for DOM elements within it's parent window. The javascript to do with would look like:

$(function () {
    var height = $(document).height();
    $('iframe', window.parent.document).height(height + 'px');
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜