Getting the Scrollbar Width

Friday, May 9, 2008

I’ve been asked a few times if Dimensions would provide a method for getting the scrollbar width. In Dimensions 1.0 I created an internal method for finding the scrollbar width to hack around some browser limitations. I eventually found other ways around those limitations and that code is no longer in Dimensions. I know that in some unusual cases it can be useful, so I want to go ahead and provide that code as one of my jQuery snippets. It is just a single method added to the jQuery namespace called getScrollbarWidth.

$.getScrollbarWidth();

Here is an example of it and here is the small script.

Posted in jQuery with 0 comments

Comments

No Comments yet…

New Comment