Reputation: 1180
i have a menu like fllowing code
and a css file to arrange items as verical menu, i show submenu with in jquery like this
$(document).ready(function(){
var ss="#menu li:hover>div";
$("div#menu li:parent").hover(function(){
$(ss).show(500);
});
});
now how i hide this submenu while mouse leave on items???? anyone can help me?
Upvotes: 0
Views: 767
Reputation: 1182
You mean somethign like this:
var ss = "#menu li:hover>div";
$("div#menu li:parent").hover(
function() {
$(ss).show(); //this is the mousein
},
function() {
$(ss).hide(); //this is the mouseout
}
);
Remember that hover can take two callbacks, and the second callback will be called when the mouse leaves the element.
Upvotes: 1