View Full Version : getting scrollbar width on IE5 for Mac

04-18-2005, 11:08 PM
Hi, I really, really need to find a way to get the width in pixels of the vertical scrollbar in an HTML document. The problem is document.body.offsetWidth returns the same value as document.body.clientWidth on Mac's IE5 and thus I cannot substract one from the other and get the width of the scrollbar. I won't go into details about what I'm trying to accomplish with this cause its complicated but just believe me when I tell you getting the scrollbar's width is the only way to solve my problem... Please, does anyone know a different way to this? (it doesn't even have to be Javascript: vbscript, asp, whatever as long as it works on mac explorer :() thanks in advance..

04-19-2005, 12:42 AM
Ok, i've figured it out, but there's still one problem... Here's my theory:
I disable scrolling momentarilly inside the frame (i'm using frames btw) and use document.body.offsetWidth to measure the width of the page without scrollbars (since there are none by now). Then, I enable the scrollbars again and measure the width of the page with the scrollbar using document.body.offsetWidth. Then I substract one from the other and thats it!!
The problem is.. how do I disable the scrollbars in the frame? any ideas?