IE7中的IFrame滚动条问题

时间:2010-06-20 14:36:02

标签: javascript html css iframe internet-explorer-7

我正在使用IFrame,我似乎无法找到一种方法来禁用IE7中的水平滚动条。我需要垂直滚动条,但我想完全禁用水平条。

在此处查看IFrame设置:Iframe Example

我使用以下方法禁用了其他浏览器中的水平滚动:

overflow-x: hidden;
overflow-y: scroll; 

但这似乎在IE7中不起作用。有什么想法吗?

编辑:我将horizo​​nalscrolling行放在Iframe标记中:

<script type="text/javascript">
      var GB_ANIMATION = true;
      $(document).ready(function(){
        $("a.greybox").click(function(){
          var t = this.title || $(this).text() || this.href;
          horizontalscrolling = "no";
          GB_show(t,this.href,560,800);
          return false;

        });
      });
    </script>

我还禁用了外页中body元素的滚动:

html {
overflow-x: hidden;
}

这些解决方案都没有解决问题。

1 个答案:

答案 0 :(得分:1)

两种方法:

  • 滚动条不是<iframe>标记的属性,它是其包含的页面的属性。尝试将overflow-x: hidden放在内部页面的<html>元素上,该元素包含在iframe中。

  • horizontalscrolling = "no"(这不是文档)

有趣的是,您可以使用scrolling = "No"标记上的iframe隐藏所有滚动条。