开发者

How to detect if they left the Webpage?

I need to be able to know if the user minimized t开发者_StackOverflow中文版he webpage or went to another Tab in their browser, Is that possible?


Afraid not, the closest you can get is blur/focus on the window object like this:

$(window).blur(function() { console.log('left'); });
$(window).focus(function() { console.log('came back'); });
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜