Skip to content

Instantly share code, notes, and snippets.

@LinuxDoku
Created July 2, 2010 19:43
Show Gist options
  • Save LinuxDoku/461819 to your computer and use it in GitHub Desktop.
Save LinuxDoku/461819 to your computer and use it in GitHub Desktop.
// standard time - remember, time 1 second --> 1000
var time = 2000;
// our function to load the map
function loadMap(newTime) {
if(newTime == 4000) {
time = 2000;
}
$("#r3").load('response.php');
window.setTimeout("loadMap("+time+");", time);
}
// onclick we reduce the time
$('#link').click(function() {
time = 4000;
});
// now after document was loaded start the load
$(document).ready(function() {
loadMap(time);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment