I’m using four DIVs that look as follows:
<div class"first">1</div>
<div class"second">2</div>
<div class"third">3</div>
<div class"fourth">4</div>
If the cursor is over the “second” DIV, background of that DIV should change as well as the background of the previous div (“first”). Also, if the cursor hover over “third” DIV both previous (“first” and “second”) should change the background color. If the cursor is over the div “fourth” the previous three DIVs (“first”, “second” and “third”) should change the background.
How can I do that using Jquery?
===EDITED===
jsFiddle: http://jsfiddle.net/sw9YV/10/
try this html:
and this js: