1

Possible Duplicate:
Javascript : Get the browser's scrollbar sizes

I have an HTML table that contains lots of rows and columns. Therefore, it has vertical and horizontal scroll bars.

How can I get the dimensions in pixels of these scroll bars in Javascript/jQuerys ?

Community
  • 1
  • 1
Misha Moroshko
  • 166,356
  • 226
  • 505
  • 746

1 Answers1

0

Ben Alman has a nice scrollbarWidth plugin that works nicely.

var content = $('#content').css( 'width', 'auto' ),
  container = content.parent();

if ( content.height() > container.height() ) {
  content.width( content.width() - $.scrollbarWidth() );
}
PetersenDidIt
  • 25,562
  • 3
  • 67
  • 72