jquery - Hover any link then hide certain div -
i summarize issue: http://jsfiddle.net/marciano/bszan/
i have links
<a href="">some text 1</a> <a href="">some text 2</a> <a href="">some text 3</a> <a id="menu" href="">menu</a> <a id="submenu" href="">submenu</a>
and js
$(function() { $('#submenu').hide(); $('#menu').hover( function() { $('#submenu').show(); } ); });
when hover menu, submenu shows up.
what need hide 'submenu' when hover of other links 'menu'. thank you
try this:-
$(function () { $('#submenu').hide(); $('#menu').hover(function () { $('#submenu').show(); }); $('a:not(#menu,#submenu)').hover(function () { $('#submenu').hide(); }) });
Comments
Post a Comment