faqts : Computers : Programming : Languages : JavaScript : DHTML

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

34 of 45 people (76%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

are you able to change the color of scroll bars?

Nov 22nd, 2001 14:12
ASA Admin, Jean-Bernard Valentaten, Colin Fraser, Nicholas Thomas, ASA Admin.


> Dynamically with a Javascript, no, all you can do is turn them on or 
> off.
> I recently recieved an email from Phillip Oertel,  of 
> me@phillipoertel.com, who stated 
>    not true. colors can be changed (IE5), but not the width (i 
> experimented...)
> Well, if you want to take advantage of Microsoft's colour controls 
> then yes you can probably change colours of just about all elements 
> using a Javascript. However,  just be aware that Netscape does not 
> give you the same control, nor does Opera, and I have no idea about 
> how other browsers handle the same issues nor earlier versions of IE. 
> Herein lies the biggest dilemma of developing Web pages. How can you 
> handle all the different types of browsers there are? Simple, dont 
> try, dont try to be all things to all people. Keep your pages small 
> and as generic as possible, that way all browsers can see every 
> effect you want. This is my personal opinion only though, I am sure 
> many people will disagree, but then I DGAF. All I want is something I 
> can see that is fairly straightforward and loads relatively quickly. 
> Fancy effects and complex pages are lost to me, They take too much of 
> my time to load and to view. If the information in them is worth it 
> then OK but this is a rarity.
What you can do, is to dynamically change the style of just any element 
(CSS is the keyword here). But please keep in mind that only IE5+ and 
NN6 do support CSS2 (and then only partially)!!
..........
ASA Admin.
This is the code for css if you really want to change the colour of the 
scroll bar! it works with IE6 as well.
<style type="text/css">
body {
scrollbar-arrow-color: black;
scrollbar-base-color: black;
scrollbar-dark-shadow-color: orange;
scrollbar-track-color: black;
scrollbar-face-color: orange;
scrollbar-shadow-color: red;
scrollbar-highlight-color: silver;
scrollbar-3d-light-color: orange;
}
</style>
Cheers ASA