View Full Version : Browser scroll bar - detectable?

04-04-2003, 03:47 PM

Is there a way to detect if the browsers scroll bar is shown, my question is only directed to IE browsers. I know there's a reserved area on the right-hand side of approx 20px, but is there a way to detect if content runs off the page and the scroll bar is shown. Thanks very much for any help.

04-04-2003, 11:25 PM
I don't know if there is a way, but in css, you can use overflow

//i think this is how it is
html {overflow: hidden

//might be
body {overflow:hidden

mabey that might help for you.

04-04-2003, 11:35 PM
if ( document.body.scrollHeight > document.body.clientHeight )
// vertical scrollbars present
// no vertical scrollbars present
}source: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/om/measuring.asp

04-07-2003, 09:23 AM
Thanks chrismiceli for your suggestion but i was looking for a solution in javascript - nice one Beetle your solution works fine, thank you :thumbsup: