我有一个带有居中 iframe 的网站,它具有固定的高度和宽度。所以你不能在 iframe 内滚动,但你可以滚动整边。
问题: 当我想滚动整边,但我将鼠标悬停在 iframe 的区域上时,它不起作用。我必须将鼠标移到一边,使其不再位于 iframe 上方。我只在 Firefox 中遇到这个问题。
iFrame 的 CSS,body scroll 是标准的:
.frame{
width:1024px;
height:768px;
top:50%;
margin-top:-384px;
border:0;
z-index:1;
overflow:hidden;
position:absolute;
}
最佳答案
删除您的 CSS overflow
属性。
.frame{
width: 1024px;
height: 768px;
top: 50%;
margin-top: -384px;
border: 0;
z-index: 1;
overflow: scroll; /* not necessary */
position: absolute;
}
关于html - 光标位于 iFrame 区域时不滚动 (Firefox),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11309323/