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 ?
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 ?
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() );
}