jastroem
asked on
detect if a scroll bar is present or not
Hi
Is it possible to find out if a document have the scrollbars (horizontal, vertical or both) currently displayed (visable)?
Sort of...
<script>
funtion findScrollBar(){
if (the scrollbars are currently being displayed){
alert ('scrollbars are visable');
}
else {
alert ('no scrollbars visable');
}
}
</script>
must not work in NS4
Hope someone can help!
Kind regards
Joergen
Is it possible to find out if a document have the scrollbars (horizontal, vertical or both) currently displayed (visable)?
Sort of...
<script>
funtion findScrollBar(){
if (the scrollbars are currently being displayed){
alert ('scrollbars are visable');
}
else {
alert ('no scrollbars visable');
}
}
</script>
must not work in NS4
Hope someone can help!
Kind regards
Joergen
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Dear Experts
Thank you for your solutions - which both works fine!
I give the points to b1xml2 - not for the reason that COBOLdinosaur's answer isn't good, it also works fine - because that script will not perform a short scrolling of the page to determine if the scroll bars are present or not.
Kind regards
Joergen
Thank you for your solutions - which both works fine!
I give the points to b1xml2 - not for the reason that COBOLdinosaur's answer isn't good, it also works fine - because that script will not perform a short scrolling of the page to determine if the scroll bars are present or not.
Kind regards
Joergen
<html>
<head>
</head>
<body>
hello
<script language="JavaScript">
<!--
document.body.scrollTop+=1
if (document.body.scrollTop==
document.body.scrollLeft+=
if (document.body.scrollLeft=
//-->
</script>
</body>
</html>
Cd&