What\'s the fastest way of checking whether an element has scroll bars?
One thing of course is checking whether element is larger than its viewport, which can easily
none of this answers are correct. you have to use this :
var div = document.getElementById('container_div_id'); var hasHorizontalScrollbar = (div.offsetWidth > div.clientWidth); var hasVerticalScrollbar = (div.offsetHeight > div.clientHeight);