Alec Smart
Alec Smart

Reputation: 95880

Firefox 3 window focus and blur

$(window).blur(function(){ windowFocus = false; }).focus(function(){ windowFocus = true; });

The problem is that in firefox 3, when I create a new tab, it does not lose windowFocus. Where as in ff2, ie7 it does lose. In ff3 it only loses window focus when i select another program.

Anyone have a solution to this problem?

Upvotes: 2

Views: 3716

Answers (1)

Shog9
Shog9

Reputation: 159590

Attach to the events on document instead:

$(document).blur(function(){
        windowFocus = false;
}).focus(function(){
        windowFocus = true;
});

...FWIW, this appears to have been fixed in FF3.5.

Upvotes: 1

Related Questions