kidh0/jquery.idle — pull request #5 by DanH42 (2014-02-27 00:46:30+00:00)
Title: Added onHide and onShow callbacks to be executed when window changes visibility

Knowing whether the user is currently looking at the page or not is something that's closely related to what this plugin already does, so I think it would be a great addition. It's especially useful when you want an instant notification that you've lost the user's attention.

It hooks the `visibilitychange` event, which most modern browsers support.