Skip to content

Instantly share code, notes, and snippets.

@psykzz
Created September 3, 2012 23:37
Show Gist options
  • Save psykzz/3614864 to your computer and use it in GitHub Desktop.
Save psykzz/3614864 to your computer and use it in GitHub Desktop.
<script>
<!-- // Timeout for reloading the fucking shit.
var repeatTimer = 3000;
var timer = false;
$(document).ready(function(){
$(window).bind("focus",function(event){
if (repeatTimer!=3000) {
repeatTimer = 3000;
timer = setTimeout(function(){load()},repeatTimer);
}
}).bind("blur", function(event){
repeatTimer = 30000;
});
});
function load () {
$('#intel').load('ajax.php');
clearTimeout(timer);
$("#ajaxbar").css( "width","0%" );
$("#ajaxbar").animate( { "width": "100%" }, { queue: false, duration: repeatTimer });
timer = setTimeout(function(){load()},repeatTimer);
} timer = setTimeout(function(){load()},repeatTimer);
history.pushState(null, "Hush", "index.php"); // change the url :D cause im boss.
-->
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment