jQuery Minute™

…a jQuery Minute™ later and you're done!



Calculate Browser’s Scrollbar Width

with 2 comments

Here’s a solution for calculating the brower’s scrollbar width. Tested in Internet Explorer 6 & 7, Firefox 1.5+ and Safari.

Calculate Brower’s Scrollbar Width

Written by jdsharp

December 10th, 2007 at 2:17 pm

Posted in Code-bits

2 Responses to 'Calculate Browser’s Scrollbar Width'

Subscribe to comments with RSS or TrackBack to 'Calculate Browser’s Scrollbar Width'.

  1. doesn’t work in chrome 5 and safari 4 on mac

    phil

    6 Apr 10 at 9:04 pm

  2. I noticed that this doesn’t work in Chrome 5.0.366 in OS X 10.6.3. It’s likely that it doesn’t work in previous versions of Chrome as well. The problem seems to be that a block level element with auto width doesn’t narrow when its parent element gains a scrollbar. The only fix I can think of is to set the inner element’s width to 100%, which, of course, breaks it in IE 7.

    Rob

    9 Apr 10 at 5:13 pm

Leave a Reply