Created
July 2, 2010 19:43
-
-
Save LinuxDoku/461819 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// 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