【问题标题】:No Scrolling when the Cursor is on the iFrame Area (Firefox)光标位于 iFrame 区域时不滚动 (Firefox)
【发布时间】:2012-07-03 18:59:15
【问题描述】:

我有一个居中 iframe 的网站,它具有固定的高度和宽度。所以你不能在 iframe 内滚动,但你可以滚动整个边。

问题:当我想滚动整个边,但我的鼠标悬停在 iframe 的区域上时,它不起作用。我必须将鼠标移到一边,使其不再位于 iframe 上方。我只在 Firefox 中遇到这个问题。

iFrame的CSS,正文滚动是标准的:

.frame{
    width:1024px;
    height:768px;
    top:50%;
    margin-top:-384px;
    border:0;
    z-index:1;
    overflow:hidden;
    position:absolute;
}

【问题讨论】:

  • 你说因为固定的宽度和高度不能滚动,然后你说你可以滚动'整个边'?你能澄清一下吗?
  • 我上传了一张图片:desmond.imageshack.us/Himg51/… 白框是一个 iframe,它位于中间(iframe 内没有滚动)。现在,当我在 iframe (白框)区域中用光标向下滚动时,我无法滚动,但如果我离开它,它就可以工作。我只在 Firefox 中遇到了这个问题。

标签: html css firefox iframe


【解决方案1】:

删除您的 CSS overflow 属性。

.frame{
    width: 1024px;
    height: 768px;
    top: 50%;
    margin-top: -384px;
    border: 0;
    z-index: 1;
    overflow: scroll; /* not necessary */
    position: absolute;
}

【讨论】:

    猜你喜欢
    • 2015-07-06
    • 1970-01-01
    • 2021-09-18
    • 2023-03-21
    • 2011-12-21
    • 1970-01-01
    • 2018-11-25
    • 2014-09-04
    • 1970-01-01
    相关资源
    最近更新 更多