Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing scrollbar using JS

Status
Not open for further replies.

BobTB

Technical User
Oct 28, 2002
37
AU
I have a web page that is 580px long. When I view the page in Netscape 7 there a no greyed-out scrollbars on the far right of the page. But in Internet Explorer 6, the scroll bar is shown on the far right of the page but greyed-out because the page doen't require a scroll bar. Is there a way using javascript or some other method to totally remove the greyed-out scroll bar from IE6. I need to remove it because of a problem with menu positioning on the page.

Thank You
 
try putting this in your <body> tag:

scroll=no

or scroll=auto

that will make ie check to see if it needs to display scrollbars. you could also do it with stylesheets:

<body style=&quot;overflow:auto;&quot;> Robert Carpenter
questions? comments? thanks? email me!
linkemapx@hotmail.com
Icq: 124408594
online.dll

AIM & MSN: robacarp
 
You can fake it.

1/ Put iE6 into quirks mode (no strict doctype)

2/ When you require the scrollbar to be hidden apply the following (where #000000 = your background colour):

document.body.style.scrollbarDarkShadowColor = &quot;#000000&quot;
document.body.style.scrollbarFaceColor = &quot;#000000&quot;
document.body.style.scrollbarHighlightColor = &quot;#000000&quot;
document.body.style.scrollbarArrowColor = &quot;#000000&quot;
document.body.style.scrollbarTrackColor = &quot;#000000&quot;
document.body.style.scrollbar3dLightColor = &quot;#000000&quot;
document.body.style.scrollbarShadowColor = &quot;#000000&quot;

3/ When the scrollbars need to be visible:

document.body.style.scrollbarDarkShadowColor = &quot;&quot;
document.body.style.scrollbarFaceColor = &quot;&quot;
document.body.style.scrollbarHighlightColor = &quot;&quot;
document.body.style.scrollbarArrowColor = &quot;&quot;
document.body.style.scrollbarTrackColor = &quot;&quot;
document.body.style.scrollbar3dLightColor = &quot;&quot;
document.body.style.scrollbarShadowColor = &quot;&quot;
 
Yes but what happens if someone has more menu bars set up in their version or they have a smaller screensize or they are using AOL all of these will have a smaller display area requiring scrollbars and your menu will still be messed up It's not a lie if you believe it!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top