当可见性发生变化时,IFrame滚动条会在Chrome上消失

Ale*_*rez 7 html javascript iframe google-chrome scrollbar

Windows上的Google Chrome浏览器是否存在渲染iframe滚动条的问题?

我写了一个非常简单的代码来显示正在发生的事情(至少我在chrome 52.0.2743.82 m上):

  <button>Toggle visibility</button>
  <br />
  <iframe scrolling="yes" seamless src="https://en.wikipedia.org/wiki/Lorem_ipsum" frameborder="0" style="width: 700px; height: 300px"></iframe>

  <script type="text/javascript">
    $("button").on("click", function() {
      $("iframe").toggle();
    });
  </script>
Run Code Online (Sandbox Code Playgroud)

Plunker链接到代码

加载页面时,可以看到iframe作为滚动条.

隐藏并显示iframe单击按钮.滚动条消失.

这个问题显然只发生在chrome中.

有人也在经历这个吗?任何修复/解决方法?

lep*_*pix 4

似乎该错误是在 Chrome 52.0.2743.82 更新中出现的(http://googlechromereleases.blogspot.fr/2016/07/stable-channel-update.html

一种可能的解决方法是使用属性visibilitywithposition: absolute而不是display显示或隐藏iframe.

此项目存在 chrome 错误票:https://bugs.chromium.org/p/chromium/issues/detail ?id=641881