禁用的滚动条(显示为灰色),但IE7中除外 [英] Disabled scroll bar (grayed out), except in IE7
问题描述
我有一个覆盖层,并且在滚动条仍然可见(呈灰色)时禁用滚动,我使用了:
I have an overlay and to disable scrolling while the scroll bar is still visible (grayed out), I used:
CSS
html.noscroll {
position: fixed;
overflow-y: scroll;
width: 100%;
}
它在IE8及更高版本中正常运行,但在IE7中,滚动条仍处于启用状态,并且我仍然可以滚动浏览页面.
It works properly in IE8 and higher, but in IE7 the scroll bar is still enabled, and I can still scroll through the page.
有人知道我如何解决这个问题吗?
Does anybody have an idea how I can solve this problem?
推荐答案
overflow:scroll使IE在所有情况下都显示滚动条,即使不需要滚动条也是如此.那就是你想做的?
overflow:scroll makes IE displaying the scrollbar in all cases, even if it is not needed. That's what you want to do ?
IE6&已知7个在与"position:relative"或"width:100%"和页边距配合使用时出现滚动问题.
IE6 & 7 are known to have scrolls issues when coupled with 'position:relative' or 'width:100%' and margins.
尝试
width: 80%;
如果滚动条正确显示为灰色,则可能是页边距/填充问题.如果没有任何变化,请尝试更改位置.
If scrolls are correctly greyed, you probably have a margin/padding issue. If it changed nothing, try changing the position.
这篇关于禁用的滚动条(显示为灰色),但IE7中除外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!