javascript - Event for when user switches browser tabs -


I am looking for an incident that the user will switch from page to second tab, and another incident when The user switches back to the tab again.

window.onblur and window.onfocus in all browsers

Can I see a proxy to synthesize this event?

You can try to use a framework, such as MooTools or jQuery which is a cross-browser Provide support. They should be able to detect more reliability with the Blurring and Focus events for the browser window.

I have personally used jQuery with a lot of success:

  $ (window) .blur (function (e) {// put the blur action here} ); $ (Window). Focus (function (e) {// focus action here}};  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -