Remove class when move to next menu item
Posted
by danit
on Stack Overflow
See other posts from Stack Overflow
or by danit
Published on 2010-03-25T16:16:42Z
Indexed on
2010/03/25
16:33 UTC
Read the original article
Hit count: 210
jQuery
I have a simple nav made up of the following HTML;
<div class="inner">
<div class="button"><img class="portal" src="images/portalbutton.png" /></div>
<a href="#"><div class="prod_description"> </div></a>
</div>
There are a number of items (All set to float left along side each other) to make up a nav bar.
When I hover over .button
and/or .prod_description
I want the .inner
<div>
to have the class .hover
added to it. This is so I can set a background image around the whole thing (Kind of like highlighting the nav item).
I only then want to remove .hover
when another .button or .prod_description
is hovered over, in which case this nav item takes the .hover
class.
© Stack Overflow or respective owner