Firefox 3 window focus and blur

社会主义新天地 提交于 2020-01-24 12:03:09

问题


$(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?


回答1:


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.



来源:https://stackoverflow.com/questions/844689/firefox-3-window-focus-and-blur

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!