Reputation: 72975
I have an image slider that slides automatically. Because I'm nice, I want to ensure that it doesn't continue to slide when the user has a different window/tab focused.
What events fire when leaving a tab/window, and which fire when returning?
Upvotes: 4
Views: 1526
Reputation: 66415
When leaving: blur
; when entering: focus
. Additionally, the following can happen:
click
when the user clicks on the window to get focus;mouseover
when the user moves over the window;mousedown
/mouseup
(related to clicking);keyup
/keydown
when pressing a key (e.g. ctrltab).Upvotes: 3