$(document).ready(function() { $(".menu_top > ul > li").mouseover(function() { this.IsOver=true; var elt=$(this).find("div"); var pos=$(this).position(); elt.css("position","absolute"); elt.css("z-index","100"); elt.css("top",(pos.top+27).toString()+"px"); elt.css("left",(pos.left+5).toString()+"px"); elt.show("normal"); }).mouseout(function(e) { this.IsOver=false; $(this).oneTime(1000,function() { if(this.IsOver) return; $(this).find("div").hide('fast'); }); }) ; });