【问题标题】:jquery - Observing an iFrame Body's scroll high and expanding to prevent a scroll bar?jquery - 观察 iFrame Body 的滚动高度并展开以防止滚动条?
【发布时间】:2010-12-01 07:19:35
【问题描述】:

我有一个 iframe,可以在顶部窗口内增长。

我想通过增加 iframe 的高度来防止 iframe 出现滚动条,从而防止出现垂直滚动条。可能吗?

【问题讨论】:

    标签: jquery


    【解决方案1】:

    您可以访问所需的 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();
    

    【讨论】:

      猜你喜欢
      • 2012-03-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-07
      • 2011-02-23
      • 2012-02-26
      相关资源
      最近更新 更多