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! Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.