Forum Moderators: open

Message Too Old, No Replies

scrollbar color change on mouseover--in my external style sheet?

How to make mouseover color changes within a CSS using JavaScript.

         

xpurtwitness

11:28 pm on Oct 28, 2003 (gmt 0)

10+ Year Member



I am trying to control the scrollbar colors across my entire site. I've begun using stylesheets which is working well. However, I am wondering if there is a way to make the colors change on mouseover by adding code only to the stylesheet, not each individual page. This would apply to my master external stylesheet, not an inline. I know the code for an individual page. Thanks for your help.

DrDoc

12:34 am on Oct 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to Webmaster World!

Yes, this can be done. But, it would only work in standards compliant browsers. And, since IE is not standards compliant while being the only browser that lets you style the scrollbars (unless you've specifically changed your settings in Opera, for example) I think you're at a dead end.

Also, you can only change scrollbars on child elements. There is, for example, no way of saying "when I hover this element, make the body's scrollbars change color". The element with the scrollbar must be a child/sibling to the current element.

xpurtwitness

3:59 am on Oct 30, 2003 (gmt 0)

10+ Year Member



Hm, I was afraid of that! Although I'm sure I've come across sites that have it functioning properly, and I view with IE. I'm not too clear on the child/sibling elements. Could you offer any clarity? I still consider myself rather novice in web design.

Thanks for your help!

MonkeeSage

7:12 am on Oct 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A child element (sometimes called a 'nested' element) 'lives' inside of another element (it's 'parent' or 'container'), like....

<div> <!-- parent / container --> 
<span></span> <!-- child / nest -->
</div>

A sibling element 'lives' next to another element (it's previous and next 'siblings'), like...

<div></div> <!-- sibling --> 
<span></span> <!-- sibling -->

Jordan

xpurtwitness

6:13 pm on Oct 30, 2003 (gmt 0)

10+ Year Member



Wow...do I feel like a tool now! Somewhere deep down, I knew that. Thanks though for helping me remember!