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!
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!
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()
});
});
Possibly a duplicate of Select triggers MouseLeave event on parent element in Mozilla Firefox.
An alternative is to check if the relatedTarget
on the event object is null on mouseleave
.
See this fiddle: http://jsfiddle.net/kv0mndeg/1/