Get a deactivated scrollbar in Firefox

2019-02-11 01:22发布

问题:

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.