spacer
Yehuda Shiran August 28, 2000
Coloring Scrollbar Arrows
Tips: August 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

Starting from IE 5.5, you can set and modify the color of scrollbar arrows, on the fly. You set the color as follows:

object.style.scrollbarArrowColor = vColor;

where vColor is a color name or an RGB value.

The following TEXTAREA demonstrates the scrollbarArrowColor property (works only in IE 5.5 and up). Click one of the two links to the right of the window, and color the scrollbar arrow either red or green:

red scrollbar arrows green scrollbar arrows

Here is how we defined the above TEXTAREA and links:

<TEXTAREA ID="longWord" ROWS="5">
Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long 
Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line
Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long
Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line
Long Line 
</TEXTAREA>
<A HREF="javascript:void(longWord.style.scrollbarArrowColor='red')"><FONT COLOR="red">red scrollbar arrows</FONT></A>
<A HREF="javascript:void(longWord.style.scrollbarArrowColor='green')"><FONT COLOR="green">green scrollbar arrows</FONT></A>

Notice the usage of void() above. It is necessary to avoid overwriting of the page with the return value from the javascript: call, which is the property assignment value (red or green).


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint