What I would like to achieve is when the mouse does not hang in menu 3, the system will continue to check if the aboutMenu symbol is visible, if so, the warning “h” and the warning “nh” otherwises. The problem is that only once when the mouse leaves menu3, how to solve this problem? thanks.
$('#menu3').live('mouseout',function() { $("#aboutMenu").hover(function() { $(this).data("hovered", true); }, function() { $(this).data("hovered", false); }); if ( $("#aboutMenu").data("hovered") ) { alert ('h'); } else { alert ('nh'); } });
Updated:
Or another way to do this - the system constantly checks whether menu3 or aboutMenu is popping up, if not, a pop-up hanging message. However, this will only be done once, when the page is initialized, how do I get it to continue checking? thanks
$(document).ready(function() { $("#aboutMenu,#menu3").hover(function() { $(this).data("hovered", true); }, function() { $(this).data("hovered", false); }); if ( $("#aboutMenu,#menu3").data("hovered") ) alert ('hovered'); });
source share