Created
August 11, 2015 05:57
-
-
Save bulbul84/37710a80e8985d2057f9 to your computer and use it in GitHub Desktop.
This file contains 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
// Example One | |
<script> | |
setTimeout(function() { | |
document.body.style.background = 'red'; | |
}, 3000); | |
window.onload = function() { | |
document.body.style.background = 'green'; | |
}; | |
</script> | |
// Example Two | |
$(document).ready(function () { | |
$('#btnFade').bind('click', function () { | |
FadeOut(); | |
}); | |
function FadeOut() { | |
setTimeout(function () { FadeDiv(); }, 2000); | |
} | |
function FadeDiv() { | |
$('#dvData').fadeOut(); | |
} | |
}); | |
// Example Three | |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<title>setTimeout() and window.onload</title> | |
<img src="image.png"> | |
<script> | |
setTimeout(function() { | |
document.body.style.background = 'red'; | |
}, 3000); | |
window.onload = function() { | |
document.body.style.background = 'green'; | |
}; | |
</script> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment