开发者

Javascript window.blur()

I have this piece of code:

window.addEventListener( "focus" , function(){
    window.console.log("focus");
} , false );开发者_如何学Go

window.addEventListener( "blur" , function(){
    window.console.log("blur");
} , false );

And if I run : setTimeout("window.focus();",2000); from firebug's console I get "focus" after 2 seconds but if I run setTimeout("window.blur();",2000); I don't get "blur".

Could someone help me please? I don't understand it, it should work.


I'm not quite sure, but try this:

setTimeout(function() {
    window.blur();
}, 2000);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜