Last active
December 27, 2015 04:29
-
-
Save tiagosalgado/7266986 to your computer and use it in GitHub Desktop.
Demo for Offline.js library. Find the blog post in http://blog.tiagosalgado.com/2013/11/01/alert-users-when-they-have-lost-internet-connectivity/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://github.hubspot.com/offline/offline.min.js"></script> | |
<script src="http://github.hubspot.com/offline/js/snake.js"></script> | |
<link rel="stylesheet" href="http://github.hubspot.com/offline/themes/offline-theme-chrome.css" /> | |
<script> | |
Offline.options = { | |
game: false, | |
checks: { | |
image: { | |
url: 'http://yourcustomurl.com/offlinejs/my-image.gif' | |
} | |
} | |
} | |
var run = function(){ | |
if (Offline.state === 'up') | |
Offline.check(); | |
} | |
setInterval(run, 5000); | |
</script> | |
</head> | |
<body> | |
<div class="offline-ui offline-ui-up"> | |
<div class="offline-ui-content"> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment