Welcome to Load.net | Sign in | Help
in Search

Forcing a scrollbar in FireFox

If you have ever developed a site that is centrally aligned that has a vertical scrollbar on some pages and not on others then I am sure you have come across this problem in Firefox.  Basically the page layout appears to jump left and right when switching to a page that needs the scroll bar.  This is especially troublesome in Ajax applications as sometimes Firefox will make it look like the entire page has reloaded because of this jump in client side page width.

There is a fix which will force the scrollbar gutter (notice I did not say scroll bar) to appear and, by doing that will prevent the jumping of the page. The good news is it’s actually really simple to implement.

After investigating about 10 different fixes, this one seems to be the most reliable, and causes the fewest side effects.

html

{
       height: 100%
       overflow-x: hidden;
       overflow-y: scroll;
       overflow:-moz-scrollbars-vertical !important;
}

Published Sunday, January 06, 2008 3:06 AM by adam@loadmail.com
Filed under: , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 
Submit
Copyright 2008 Load Ltd. All Rights Reserved.