Skip to content

Instantly share code, notes, and snippets.

@ozinepank
Last active December 16, 2015 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozinepank/5352631 to your computer and use it in GitHub Desktop.
Save ozinepank/5352631 to your computer and use it in GitHub Desktop.
AddClass if mouse hover and removeClass if user mouseleave
$(".action-a").mouseenter(function(){
$(this).addClass('action-hover');
}) ;
$(".dropdown").mouseleave(function(){
$(".action-a").removeClass('action-hover');
});
<ul class="nav user_action">
<li class="dropdown">
<a class="action-a" href="#">Manage</a>
<ul class="dropdown-menu sub-list">
<li><a class="link-action" href="#">profile</a></li>
<li><a class="link-action" href="#">All Notification</a></li>
<li><a class="link-action" href="#">Manage</a></li>
</ul>
</li>
</ul>
<!-- Demo :http://jsbin.com/ocubit/3 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment