Disabled scroll bar (grayed out), except in IE7

2019-09-03 04:03发布

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条回答
唯我独甜
2楼-- · 2019-09-03 04:16

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.

查看更多
登录 后发表回答