jQuery

Checking browser tab visibility using jquery

If you are browsing website which is displaying some kind of real time data like football score or cricket score or something like that, and also want to check your facebook wall. As soon as you switch the browser tab you miss the moment. What if you can check live score while browsing other websites ? Yes thats possible now with page visibility api. You can now find if browser tab has focus or not.
I have listed both the versions for checking browser tab visibility using plain javascript and jquery. Jquery version has many advantages over plain javascript version its small, simple, light weight and you dont have to worry about the compatibility, jquery team takes care of that, Isnt it cool ?

Checking browser tab visibility using plain javascript

Checking browser tab visibility using jquery

A demo would be great start

View Demo

Leave a Comment

*

Notify me of followup comments via e-mail. You can also subscribe without commenting.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Shares

Let your friends know what are you reading

Share this post with your friends!