Blur event stops click event from working?
Solution 1:
click
event triggers after the blur
so the link gets hidden. Instead of click
use mousedown
it will work.
$('.ShippingGroupLinkList').live("mousedown", function(e) {
alert('You wont see me if your cursor was in the text box');
});
Other alternative is to have some delay before you hide the links on blur
event. Its upto you which approach to go for.
Demo
Solution 2:
You could try the mousedown
event instead of click
.
$('.ShippingGroupLinkList').live("mousedown", function(e) {
alert('You wont see me if your cursor was in the text box');
});
This is clearly not the best solution as a mousedown
event is not achieved the same way for the user than a click
event. Unfortunately, the blur
event will cancel out mouseup
events as well.