Spectacular Free Slide Show
MP3 Sound Streamer
Email Link Encoder
Stream Website Audio
Cool Free Text Scroller
CodeLifter.com
S
oftware & S
cripts by CodeBrain.com
Home
JavaScripts
PopUp Maker
-
po
pup wind
ows
CodeLifter 5
-
source viewer
ScrollBar Styler
-
color scrol
lbars
Flash Fixer
-
rem
ove al
erts
Roll-Over Maker
-
image roll-overs
Link Cloaker 5
-
enc
rypt links
Site Capture 3
-
hidden frames
CHMOD 2 Utility
-
chmod utility
BlackBird 3.0
-
browser shell
Zoom 1.0
-
magnifier
MicroTicker.com
-
text scroller
CodeBrain.com
-
j
ava app
lets
D3Q.com
-
xp icon control
BrainCode.com
-
j
ava app
lets
MailToProtector
-
protect email
Java Applets
Perl Scripts
Affiliate Program
Index
Change Scrollbar Color Dynamically
IE5.5 and Later Browsers
Index
Click to
Change Colors:
Change to Red
Change to Orange
Change to Yellow
Change to Green
Change to Blue
MouseOver to
Change Colors:
Change to Red
Change to Orange
Change to Yellow
Change to Green
Change to Blue
Click
here
to select the code in the window below.
Use Ctrl+C to copy it to your clipboard.
============================================================ Script: Change Scrollbar Color Dynamically Functions: Changes the color of the scrollbars in a page dynamically, via a simple JavaScript function; shows how to attach the scrollbar color change function to links and to mouseOver and other events. Browsers: IE5.5 and Later (ignored by other browsers) Author: etLux ============================================================ Step 1. Optional Style This is optional. If you leave it out, the browser will show the standard default color for the scrollbars (usually that is #C0C0C0). If you include this style, then you can set the initial scrollbar color to whatever you wish -- just change the #C0C0C0 to whatever color is required. The <style> ... </style> goes in the head of your page: <style> body{ scrollbar-base-color: #C0C0C0 } </style> ============================================================ Step 2. The Script Put the following <script ... </script> in the head of your page. No modifications are needed: <script> // (C) 2001 www.CodeLifter.com // http://www.codelifter.com // Free for all users, but leave in this header function changeScrollbarColor(C){ if (document.all){ document.body.style.scrollbarBaseColor = C } } </script> ============================================================ Step 3. Calling the Script To set the color, just change the #FFFFFF format colors in the parentheses. (Careful to get the syntax with the single and double quotes just right!) Usually, you'll attach the function to a link. Here's the actual code from our page, up above:
Change to Red
Change to Orange
Change to Yellow
Change to Green
Change to Blue
You can also, of course, call the code from any mouse event; for instance, try sliding your mouse over this, also from our page above, for an interesting effect:
Change to Red
Change to Orange
Change to Yellow
Change to Green
Change to Blue
Obviously, you can carry this further, using onMouseOut, onClick, or other events. ============================================================
Get The Code!
CodeLifter is a
CodeBrain.com
Sister Site
© 1995-2008 OEC Corp & CodeLifter.com
CodeLifter™ & CodeBrain™
Legal Notices
CodeBrain InterNET Group
BrainCode.com
CodeFoot.com
CodeBelly.com
D3Q.com
etLux.com
FFFast.com
IEFix.com
PopUpWorks.com
MicroTicker.com
DavidSosnowski.com
OECCorp.com
MailToProtector.com
CodeBrain.com
Free MP3
Downloads
Contemporary classical music, completely free.
.