Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

overflow:'scroll' (2 parts)

Status
Not open for further replies.

tryangle

Technical User
Mar 19, 2001
49
US
I asked this question in the Javascript forum, but didn't get any responses... but I've been still digging around trying to figure it out... I think maybe it's a CSS question instead?

I'm interested to know if the color for this scrollbar can be changed separate from the fullwindow scrollbar- I can change the color, but the change affects them both. I tried using [0] & [1] to differentiate between the two, as in a radio box array, but I got nothing. And... one more thing, how could I set the focus to the scrollable box scrollbar? I guess it would really help if I knew the DOM names. %-)
OK, Who stopped payment on my reality check?
 
Yes, you can change just the scrolling element.

Lets say it is a DIV, class of scroller -

div.scroller {
width: 100px;
height: 100px;
overflow: scroll;
scrollbar-face-color: #000000;
scrollbar-shadow-color: #FFFFFF;
scrollbar-highlight-color: #FFFFFF;
scrollbar-3dlight-color: #FFFFFF;
scrollbar-darkshadow-color: #FFFFFF;
scrollbar-track-color: #FFFFFF;
scrollbar-arrow-color: #FFFFFF;
}

and for your body, you can have different rules -

body {
scrollbar-face-color: #ffffff;
scrollbar-shadow-color: #000000;
scrollbar-highlight-color: #000000;
scrollbar-3dlight-color: #000000;
scrollbar-darkshadow-color: #000000;
scrollbar-track-color: #000000;
scrollbar-arrow-color: #000000;
}

In this example, scroller is black-on-white, and body is white-on-black.

Hope that helps. Dean Owen
 
Thank you Dean, I'll check this out to see how it works, I really appreciate it! Do you, by any chance know how to put focus on the div.scroller? Would it be <body onload=&quot;javascript:div.scroller.focus()&quot;> %-) OK, Who stopped payment on my reality check?
 
Might work. Try it.

try making the div and ID instead of a class of you are going to try that. ie -

div#scroller {
blah
}

or giving it the name of scroller. Dean Owen
 
Thanks again Dean!
Your advice on making the scroller color different from the main window worked great AND onload=&quot;scroller.focus()&quot; works too! I like it! %-) OK, Who stopped payment on my reality check?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top