Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Test</title>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js" type="text/javascript"></script>
- <script src="http://papermashup.com/demos/ajax-switch/jquery.iphone-switch.js" type="text/javascript"></script>
- <script>
- var refreshTimer;
- function enableTimer()
- {
- refreshTimer = setTimeout(function(){ location.reload(true); }, 5000);
- window.location.hash = "#autoreload";
- }
- function disableTimer()
- {
- clearTimeout(refreshTimer);
- window.location.hash = "";
- }
- $(function() {
- $('#button').iphoneSwitch(
- (window.location.hash == "#autoreload" ? "on" : "off"),
- enableTimer,
- disableTimer
- );
- if (window.location.hash == "#autoreload")
- enableTimer();
- });
- </script>
- </head>
- <body>
- <div id="button"></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement