Get a deactivated scrollbar in Firefox

a 夏天 提交于 2019-12-18 17:36:07

问题


I have a Javascript tabbed dialog whose pages have different heights. Some of them are taller than the browser window.

In Internet Explorer, there is always a scrollbar to the right. When it is not needed, it is greyed out. The page dimensions stay the same and there is no problem.

In Firefox, the Scrollbar is hidden completely when not needed constantly changing the page's dimensions on each page change and thus the width of the whole tabbed dialog (it has a relative width). This is very annoying.

Is there any way to bring the deactivated scrollbar "back" to Firefox, or any other way to work around this?


回答1:


Add the following line to your userContent.css:

html { overflow: -moz-scrollbars-vertical !important; }



回答2:


You can use the CSS3 overflow-y property:

html
{
  overflow-y: scroll;
}

This works in Firefox, Chrome, Safari and IE 8.



来源:https://stackoverflow.com/questions/1735936/get-a-deactivated-scrollbar-in-firefox

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