Created
February 28, 2014 01:43
-
-
Save cflove/9263591 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script> | |
<style type="text/css" media="screen"> | |
.box {background-color: red; width: 80px; height: 80px; display: inline-block;} | |
</style> | |
</head> | |
<body> | |
<div class="box"></div> | |
<div class="box"></div> | |
<div class="box"></div> | |
<div class="box"></div> | |
<div class="box"></div> | |
<script type="text/javascript"> | |
// function sayHello() { | |
// alert("hello") | |
// } | |
// setTimeout(sayHello, 2000) | |
// ===================================================================== | |
// var greeting | |
// function sayHello() { | |
// var greeting = "Hello " | |
// alert("function said : " + greeting) | |
// } | |
// setTimeout(sayHello, 2000) | |
// alert("page said : " + greeting) | |
// ===================================================================== | |
// var setValue = function() { | |
// var states = $.Deferred(); | |
// function sayHello() { | |
// // states.resolve(); | |
// states.reject(); | |
// var greeting = "Hello" | |
// alert("function said : " + greeting) | |
// } | |
// setTimeout(sayHello, 4000) | |
// return states.promise() | |
// } | |
// var x = setValue() | |
// x.done(function(){ | |
// alert("Function Triggered") | |
// }) | |
// x.fail(function() { | |
// alert("Failed!") | |
// } ) | |
// ===================================================================== | |
// $('.box').each(function(index, val) { | |
// // alert(index) | |
// $(this).delay(1000*index).fadeOut('slow') | |
// }).promise().done(function(){ | |
// alert("All Done") | |
// }); | |
// ===================================================================== | |
// fadeBoxes = function() { | |
// return $('.box').each(function(index, val) { | |
// $(this).delay(1000*index).fadeOut('slow') | |
// }) | |
// } | |
// ShowBoxes = function () { | |
// return $('.box').each(function(index, val) { | |
// $(this).delay(1000*index).fadeIn('slow') | |
// }) | |
// } | |
// fadeBoxes().promise().done( ShowBoxes ) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment