问题
http://jsfiddle.net/msNhr/
When you go over "aaaaa" an overlay is display, when you try to select something from the select within the overlay closes. How do I get this right?
The overlay should only close if the actual overlay area is left.
Thanks!
回答1:
see this fiddle: http://jsfiddle.net/msNhr/3/ (tried on Fx14 and Ch 21.0.1180.57)
I've just stopped the propagation of mouseleave event so it won't reach the overlay
relevant js
$(function() {
$('#a').mouseenter(function() {
$('#overlay').show();
});
$('#overlay').mouseleave(function() {
$(this).hide();
});
$('#overlay select').mouseleave(function(ev) {
ev.stopPropagation()
});
});
来源:https://stackoverflow.com/questions/11781518/mouseenter-mouseleave-and-a-select