How can I trigger a mouseout event for two elements in jQuery?
问题 Let's suppose I have two spearate divs, A and B, which overlap at a corner: +-----+ | | | A | | +-----+ +---| | | B | | | +-----+ I want to trigger an event when the mouse leaves both A and B. I tried this $("#a, #b").mouseleave(function() { ... }); But this triggers the event if the mouse leaves either node. I want the event to be triggered once the mouse is not over either node. Is there an easy way to do this? I had an idea that involved global variables keeping track of the mouse state