I have the following menu structure:
<ul class="menu">
<li class="first leaf"><a href="#" title="" class="active">Home</a></li>
<li class="expanded"><a href="#" title="Products">Products</a>
<ul class="menu">
<li class="first leaf"><a href="#">Product 1</a></li>
<li class="leaf"><a href="#">Product 2</a></li>
<li class="leaf"><a href="#">Product 3</a></li>
<li class="last leaf"><a href="#">Product 4</a></li>
</ul
<li>
<li class="expanded"><a href="#" title="Products">Products Level 2</a>
<ul class="menu">
<li class="first leaf"><a href="#">Product 5</a></li>
<li class="leaf"><a href="#">Product 6</a></li>
</ul>
<li>
</ul>
What I’m looking to do is, when the Product 1 item is hovered, I want the parent Products menu item to change.
I’ve looked into CSS to do this, by trying to target the parent based on the child, but seems like it cannot be done.
Can this be done in jQuery?
Thanks
It depends on how you want it to be changed?
Edit: Updated DEMO for 2 li submenu’s
Just with CSS:
DEMO – Font & background
DEMO – Just the font