【发布时间】:2010-12-01 07:19:35
【问题描述】:
我有一个 iframe,可以在顶部窗口内增长。
我想通过增加 iframe 的高度来防止 iframe 出现滚动条,从而防止出现垂直滚动条。可能吗?
【问题讨论】:
标签: jquery
我有一个 iframe,可以在顶部窗口内增长。
我想通过增加 iframe 的高度来防止 iframe 出现滚动条,从而防止出现垂直滚动条。可能吗?
【问题讨论】:
标签: jquery
您可以访问所需的 iframe 元素。
iframe = $('#myiFrame');
iframe_document = iframe .contents().find('body').parent(); // this one looks little weird, but i can't think of better solution
iframe_document_height = iframe_document.height();
iframe_height = iframe.height();
【讨论】: