Disabled scroll bar (grayed out), except in IE7

心不动则不痛 提交于 2019-12-13 05:29:34

问题


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%;
}

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?


回答1:


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 are known to have scrolls issues when coupled with 'position:relative' or 'width:100%' and margins.

Try with

width: 80%;

If scrolls are correctly greyed, you probably have a margin/padding issue. If it changed nothing, try changing the position.



来源:https://stackoverflow.com/questions/20482557/disabled-scroll-bar-grayed-out-except-in-ie7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!