Reputation: 31313
Referencing this fiddle
I want to color the background of the LI being hovered over. However it seems to set the class on the entire set of LI elements (not just the hovered one).
Can someone see what the issue is here?
Upvotes: 2
Views: 831
Reputation: 29912
This is because you anchor your JS to the whole list.
See that.
I don't remove all JQuery stuff, but only what set to hover your li class. I suggest to remove JS that know is useless
Upvotes: 1
Reputation: 1828
just do this:
.parentSelectorBox li:hover
{
background-color:red;
}
you don't need js to achieve hover effect. CSS will be fine.
Upvotes: 2