Forum Moderators: not2easy

Message Too Old, No Replies

div2 hover: div1 color change

         

jalarie

9:37 pm on Aug 25, 2010 (gmt 0)

10+ Year Member



Div1 contains div2 and div3. When the mouse hovers over div2, I want the div1 background color to change. Hovering over div3 should produce a different color change to div1. The set looks like this:


<div id="div1">
<div id="div2">content for div2.</div>
<div id="div3">content for div3.</div>
</div>

milosevic

12:58 pm on Aug 26, 2010 (gmt 0)

10+ Year Member



I think this is beyond what CSS is capable of, you will need to use JavaScript to set the CSS, pseudocode something like

if (hover div2) {
div1 css = background-color:blue;
}
elseif (hover div3) {
div1 css = background-color:red;
}

jalarie

8:50 pm on Aug 26, 2010 (gmt 0)

10+ Year Member



Thank you. I was afraid that might be the case.

Shado

10:54 am on Aug 27, 2010 (gmt 0)

10+ Year Member



Just throwing this out there but can't you a href on the div - that should enable you to implement the hover effect. Through all my readying I understand this will work except in IE6 and lower.