?
Solved

Change browser scrollbar color

Posted on 2003-11-20
10
Medium Priority
?
2,298 Views
Last Modified: 2010-04-09
Hello,

How can the browser's scrollbar color change, like on this link:

http://www.woodyswatch.com/access/

0
Comment
Question by:ornicar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
10 Comments
 
LVL 8

Assisted Solution

by:MusicMan
MusicMan earned 400 total points
ID: 9788385
Try here

http://www.codelifter.com/main/javascript/changescrollbarcolor1.html

They have a neat script to do just what you want.

HTH
MM
0
 
LVL 15

Expert Comment

by:Daydreams
ID: 9788756
You can do it easily with CSS:
(From http://www.websitetips.com/info/css/scrollbars.html)

<html>
<head>

<style type="text/css">
<!--

body {scrollbar-3dlight-color:gold;
scrollbar-arrow-color:yellow;
scrollbar-base-color:tomato;
scrollbar-darkshadow-color:orange;
scrollbar-face-color:teal;
scrollbar-highlight-color:hotpink;
scrollbar-shadow-color:magenta}


-->
</style>

</head>
<body>
<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>. The <p>'s are here just to fill the page so you can see the whole scrollbar since there is no other content to scroll.
</body>
</html>

0
 
LVL 15

Accepted Solution

by:
Daydreams earned 800 total points
ID: 9788821
Or try this fun script, (and hover your mouse over the scrollbar to see the color change):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>scrollbar colors onmouse</title>
</head>
<body onmousemove="move()" link="#00FFFF" vlink="#00FFFF">

<script language="javascript"><!--
function move()
 {
  chk = document.body.clientWidth + 2;
  if(window.event.x > chk) //Ist Mauszeiger über Scrollbar?
   {
    var sfc = "powderblue";     //scrollbar-face-color
    var ssc = "red";     //scrollbar-shadow-color
    var shc = "blue"; //scrollbar-highlight-color
    var stc = "yellow"; //scrollbar-track-color
    var sac = "green"; //scrollbar-arrow-color

    document.body.style.scrollbarFaceColor = sfc;
    document.body.style.scrollbarShadowColor = ssc;
    document.body.style.scrollbarTrackColor = stc;
    document.body.style.scrollbarHighlightColor = shc;
    document.body.style.scrollbarArrowColor = sac;
   }
  else //wenn Mauszeiger nicht über Scrollbar
   {
    var sfc = "orange"; //scrollbar-face-color
    var ssc = "red"; //scrollbar-shadow-color
    var shc = "white"; //scrollbar-highlight-color
    var stc = "lightblue"; //scrollbar-track-color
    var sac = "blue";       //scrollbar-arrow-color

    document.body.style.scrollbarFaceColor = sfc;
    document.body.style.scrollbarShadowColor = ssc;
    document.body.style.scrollbarTrackColor = stc;
    document.body.style.scrollbarHighlightColor = shc;
    document.body.style.scrollbarArrowColor = sac;
   }
 } // -->
</script>
<h1>Hover your mouse over the scrollbar<br>
 and see it change colors</h1>
<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p> <p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.<p>.
</body>

</html>
0
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

 
LVL 11

Expert Comment

by:Zontar
ID: 9789919
Note that this is MSIE/Windows only, and will not work with other browsers (and the JS solutions offered may cause errors in them as well).
0
 
LVL 9

Author Comment

by:ornicar
ID: 9790067
The CSS work only with IE?
0
 
LVL 35

Assisted Solution

by:YZlat
YZlat earned 400 total points
ID: 9796620
<style>
body {
 scrollbar-track-color:#FFC7DB;

 scrollbar-face-color:#00E9FF;
 scrollbar-highlight-color:#B5224E;

 scrollbar-3dlight-color:#FF00FF;
 scrollbar-base-color:blue;
 scrollbar-darkshadow-color:black;
 scrollbar-shadow-color:#FFD1F0;
 scrollbar-arrow-color:#DA8DFF;
}

</style>
0
 
LVL 11

Assisted Solution

by:Zontar
Zontar earned 400 total points
ID: 9797017
>  The CSS work only with IE?

Some of it will also work with recent versions of Opera for Windows *if* the user has allowed it in his preferences. The preference is disabled by default. The styles won't work at all in Mozilla, Safari, Konqeror, any version of Netscape, or IE/Mac. Personally I prefer using a browser that doesn't support this -- the purpose of CSS is to allow web authors to set the presentation of their pages, not to let them monkey around with my user interface. It would appear that W3C agrees with this sentiment, which is why none of the scrollbar-related styles are part of the CSS-2 specification. Nor will you find them in the CSS-2.1 or CSS-3 drafts.
0
 
LVL 9

Author Comment

by:ornicar
ID: 9828027
Thanks a lot.
0
 
LVL 15

Expert Comment

by:Daydreams
ID: 9828257
ornicar, you're welcome.. and thanks for the A:)
0
 
LVL 8

Expert Comment

by:MusicMan
ID: 9828660
Glad to have been of assistance :)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question