Lions Den

The Code and Times of Hanan Schwartzberg

About Hanan | Hanan's CV | Contact Hanan

October 26, 2009

Why the scrollbar won’t show on the left in Firefox

Filed under: CSS — Tags: , , , , — Hanan Schwartzberg @ 7:56 pm

The Scenario

When designing a website for a right to left (RTL) language the scrollbar should automatically be on the left hand side. The logic is that it should be at the end of the line, just as it is on the right for a left to right (LTR) language. This works fine in IE, but Firefox will always show the scrollbar on the right.

The Cause

Unfortunately this is by design. Firefox believes that the scrollbar is part of the browser, not the webpage and so by default a website should not have the ability to override the user’s settings. IE believes the scrollbar is not part of the browser but part of the page. Therefore, if a page is RTL the scrollbar should be on the left.

The Solution

This can be fixed on an individual instance of Firefox.

  1. Open Firefox
  2. Navigate to about:config
  3. Set the filter to layout.scrollbar.side
  4. Double click the layout.scrollbar.side line
  5. Change the setting to 1 and click OK

Now Firefox will behave like IE and show the scrollbar on which ever side the page dictates. Unfortunately, this will not help any of your users. The best solution to assure your RTL website displays the scrollbar on the correct side is to use a third party customizable scrollbar, such as jQuery Scrollbar or jScrollPane.

1 Comment »

  1. I am not sure if the logic of IE is correct, because it become more complicated to locate the scrollbar if it flip sides according to the document direction. Moreover, there are some common scenarios which make things more complicated such as setting the direction property to document elements, and scrollbar will appear on the wrong sides.

    I don’t like the idea of UI which change its behavior because of the loaded document, but feel free to report it as a bug to Mozilla. Please use the keyword ‘rtl’ to make it easier for us to locate your request, and you are more than welcome to CC me to your issue.

    Tomer.

    Comment by Tomer — October 26, 2009 @ 10:31 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Spam Protection by WP-SpamFree

Home | Site Design | Banner Design | Code Den | Offsite Posts | Downloads | Photography | About Hanan | Hanan's CV | Contact Hanan
Copyright © 2009 Hanan Schwartzberg. All rights reserved.