[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Change browser scrollbar color

Posted on 2003-11-20
10
Medium Priority
?
2,303 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
Technology Partners: 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!

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article discusses how to create an extensible mechanism for linked drop downs.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

656 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