Skip to content

Instantly share code, notes, and snippets.

@sarahkadar
Created June 21, 2012 10:01
Show Gist options
  • Save sarahkadar/2964955 to your computer and use it in GitHub Desktop.
Save sarahkadar/2964955 to your computer and use it in GitHub Desktop.
<html>
<head>
<script src="http://code.jquery.com/jquery-1.7.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$(document).scroll(function(e) {
if ($('body').scrollTop() < 0) {
$('#refreshing').show();
setTimeout(function(){if ($('body').scrollTop() < 0) { location.reload(true)} else { $("#refreshing").hide(); }}, 1000);
}
});
});
</script>
<style>
#refreshing {
display: none;
}
</style>
<body>
<div id="refreshing">Frissulunk!</div>
<div id="content">Foobarbaz</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment