Skip to content

Instantly share code, notes, and snippets.

Niall Kennedy niallkennedy

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am niallkennedy on github.
  • I am niallk (https://keybase.io/niallk) on keybase.
  • I have a public key ASBtnrxnPqcdyAy3NwpS6467eoKA2oRvJGyXPMpSTIeKTgo

To claim this, I am signing this object:

@niallkennedy
niallkennedy / visibility.js
Created Jun 19, 2011
Page Visibility API visibility test using jQuery
View visibility.js
var isVisible = false;
function onVisible() {
isVisible = true;
jQuery.getScript("http://www.google-analytics.com/ga.js");
}
if ( document.webkitVisibilityState === undefined || document.webkitVisibilityState === "visible" ) {
onVisible();
} else {
jQuery.bind( "webkitvisibilitychange", function() {
You can’t perform that action at this time.