View Full Version : Detect Scrollbars Presence

09-19-2007, 04:21 AM
1) CODE TITLE: Detect Scrollbars Presence

2) AUTHOR NAME/NOTES: Muhammad Shoaib Patel

This javascript will help you to detect presence of scrollbars (either x or y or both) for a div element. Just pass the parameters (div Id and Aces i.e. which side of scrollbar x or y or both you want to detect) to the javascript function and you will know whether the scroll bar exist or not. The second parameter (Aces) is optional in the javascript function, you can leave this blank if you are not sure which scrollbar could exist and you want to detect whichever (x or y) scrollbar is exist. The attached sample file detect_scrollbars_div.aspx will show few examples. This javascript was only tested on Microsoft Internet Explorer version 6.0 in VWD 2005 Express Edition environment. This is a free javascript distributed in the hope that it will be useful but without any warranty.


or, ATTACHED BELOW (see #3 in guidelines below):