Hello,
I have some simple code to add and remove a class when an li element is hovered.
- $("#nav li").hover(
- function(event) {
- $(this).addClass("hovered");
- },
- function (event) {
- $(this).removeClass("hovered");
- }
- );
The hovered class just adds a background image. When I quickly hover over the list, sometimes the background image gets stuck so it seems like the "hovered" class never gets removed. Does anybody have any ideas? Thanks.