I am currently developing a star-voting system that displays 5 stars, with the lit-up stars representing the average star rating. When hovering over a star, such as number 4, I would like to illuminate the 4th star from the right. Similarly, if hovering over 2, the two stars to the right should light up, and so on. If all 5 stars are hovered over, then all stars should be illuminated. The stars are styled using CSS classes .iconFavorite for regular stars and .iconFavorite_hover for the illuminated stars. Therefore, when hovering over 3 stars, the code appears as follows:
<div class="iconFavorite_hover"></div>
<div class="iconFavorite_hover"></div>
<div class="iconFavorite_hover"></div>
<div class="iconFavorite"></div>
<div class="iconFavorite"></div>
To see an example of this functionality in action, you can visit retardo.dk/videos.php?id=905 where you can hover over the big green stars to see them light up based on your selection.
If you're interested in how to achieve this effect, you can view my current code without jQuery on this jsfiddle: http://jsfiddle.net/8vzCC/1/