I need to be able to know if the user minimized the webpage or went to another Tab in their browser, Is that possible?
Asked
Active
Viewed 88 times
0
-
This might be of help http://stackoverflow.com/questions/147636/best-way-to-detect-when-user-leaves-a-web-page – Mahesh Velaga Jan 13 '11 at 01:42
-
Short answer: yes, it is possible. Maybe you could describe what you're trying to accomplish - chances are, it would make for horrible usability. – Matt Ball Jan 13 '11 at 01:42
-
@Mahesh: The titles are similar, but from the question body, the OP is asking something different. – Matt Ball Jan 13 '11 at 01:43
-
@Matt: Agreed, suggesting similar cases. – Mahesh Velaga Jan 13 '11 at 01:45
1 Answers
0
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'); });

Martin Jespersen
- 25,743
- 8
- 56
- 68
-
2You should mention this uses jQuery. In general, you won't get a positive reaction from assuming that a jQuery answer is acceptable. – Matt Ball Jan 13 '11 at 01:44