therealwesfoster Posted April 6, 2009 Share Posted April 6, 2009 How can I detect if the window (or tab of the window) is unfocused (or not being viewed by the user) ? Thanks! Link to comment https://forums.phpfreaks.com/topic/152860-detect-if-window-is-in-focus-or-not/ Share on other sites More sharing options...
Floydian Posted April 7, 2009 Share Posted April 7, 2009 http://www.steelbreeze.us/play_ground/isfocused.html I made an example script that displays the text box that has focus when any of the three text boxes are clicked. The key is: document.activeElement which shows what element is currently focused. Works in FF 3, IE 7/8 (haven't tested any others...) It's part of HTML 5, so IE 6 prolly doesn't like this. Link to comment https://forums.phpfreaks.com/topic/152860-detect-if-window-is-in-focus-or-not/#findComment-803145 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.