Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery blur() on Chrome not working

I'm on MacOSX running this http://jsfiddle.net/q84wv/ on Chrome latest version.

It won't work, while running that on Firefox it works perfectly, any clue?

like image 295
itsme Avatar asked Dec 02 '22 22:12

itsme


1 Answers

Assuming that you want the alert() to be triggered either when the user tabs out from the anchor, or completes a click event, this should work:

$('.menu a').on('blur mouseup',function(){
    alert('oh');
});

Check this jsFiddle.

It really depends what you're classing as blur here. If you're wanting it to trigger whenever the user's mouse leaves the element, you can use mouseleave instead:

$('.menu a').on('blur mouseleave',function(){
    alert('oh');
});
like image 141
BenM Avatar answered Dec 05 '22 11:12

BenM