window.onblur无法正常工作 [英] window.onblur not working
本文介绍了window.onblur无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我似乎无法使window.onblur正常工作.
I can't seem to get window.onblur to work properly.
window.onblur = console.log('blur');
将侦听器应用于窗口时,它只会在加载页面时运行,而不会在窗口失去焦点时运行.
When the listener is applied to the window, it just runs when the page is loaded, but not when the window looses focus.
推荐答案
window.onblur = function() { console.log('blur'); }
这篇关于window.onblur无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文