I\'ve been digging all day to find out how to style the parent li when hovering on a child li element.
e.g.
- Parent Element <
The javascript:
What this does is that when the mouse enters one of the child elements, this adds the
highlighted
class to the parent . And when the mouse leaves, the class is removed. So you just have to create a
highlighted
class now :)
$(this).closest('.page_item')
just searches for the closest parent element which matches the .page_item
selector (so, the closest parent with a page_item
class).