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:-

demo

   $(function () {     $('#submenu').hide();     $('#menu').hover(function () {         $('#submenu').show();     });     $('a:not(#menu,#submenu)').hover(function () {         $('#submenu').hide();     }) }); 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -