Archive for September, 2007

Hidden Divs with Scrollbars in Firefox on a Mac

Wednesday, September 5th, 2007

I almost never check Firefox on the Mac because I’ve always assumed that Firefox on a Mac renders web content the same as Firefox on the PC. Well, for at least one case, that assumtion has turned out to be false. The trouble is when a hidden div with an overflow of auto is in a div with an overflow of hidden. If the div is hidden because it is in the overflow region, the scrollbar will appear. See an example here http://www.errorforum.com/mozilla-firefox-error/3503-will-float-mac-firefox-scrollbars-floating-pop-up-windows.html.

Turns out this is a bug in Firefox that will be fixed in Firefox 3, but is present in current version of Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=187435.

There are a lot of work-arounds for the problem, including using JS to enable/disable overflow on the hidden div so that scrollbars don’t need to be generated, but none of the solutions worked for me for the MBN web site because the hidden div is animated as it is revealed and hidden (click on membership then alphabetical – the alphabetical div is what was causing me the problem).

The solution that worked for me was to wrap the hidden div in another div which also has an overflow of auto. This fixed the problem for me with Firefox.