View Full Version : HTML : Hiding IE scroll bar
15-03-2003, 10:51 PM
Is there a way to hide the scroll bar without using frames ?
16-03-2003, 02:36 AM
Yes there is a way, and I've written a little script for you to make it work.<html>
<title>Show Hide Scrollbars</title>
var detect = navigator.userAgent.toLowerCase();
browser = "Internet Explorer";
else if (!checkIt('compatible'))
browser = "Netscape Navigator";
else browser = "An unknown browser";
place = detect.indexOf(string) + 1;
thestring = string;
if (browser = "Internet Explorer")
else if (browser = "Netscape Navigator")
</html>I've put the functions to put the scrollbars back on in case you need them. I've also put some links in the test page so you can test it.
It is a longish script, but it's worth it, because then they get removed for the two major browsers and it is not browser specific (not really anyway).
The Threedy forums seem to put a space between the words "java" and "script" in the <a href> tags ... if they are still there when you have copy/pasted it, just remove the space.
I hope this helps,
16-03-2003, 03:12 AM
I found that on the internet in another form but is there a way to automatically hide it ?
16-03-2003, 05:29 AM
what do you mean?
you could just put scroll="no" in your body tag if you're lazy...
16-03-2003, 05:30 AM
and also scroll="auto" if you want it to scroll only when there is too much content to fit on the one screen...
16-03-2003, 05:37 AM
Thank you, that's what I was looking for. :)
16-03-2003, 08:43 AM
The one I gave is automatic — it just works on both IE and NS — if you just put scroll="no" in the body tag then it will only work on IE. It is best to be crossbrowser, but it's your choice of course.
16-03-2003, 09:03 AM
mmm, seems a fair bit off effort to just hide the scrollbar though :roll:
16-03-2003, 02:51 PM
Oh little nicky I just understood how your script works... I'm so bad at scripting...
16-03-2003, 08:45 PM
That's alright Schwinnz :).
Tim: Yeah I know it seems a lot and there might be another way to do it, but I have just got into the habit of making everything as crossbrowser as possible :).
Anyway ... some habits are good and some bad ...
vBulletin® v3.7.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.