Created
August 16, 2014 21:21
-
-
Save DannyJoris/1e6fb7392f1fcbc3cad0 to your computer and use it in GitHub Desktop.
// source http://jsbin.com/yepude/1
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
.box { | |
display: none; | |
width: 100px; | |
height: 100px; | |
border: 1px solid hotpink; | |
background: white; | |
margin: 10px; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="box box1"></div> | |
<div class="box box2"></div> | |
<script id="jsbin-javascript"> | |
function callbackFn1() { | |
$('.box1').css('background-color', 'pink'); | |
} | |
function callbackFn2() { | |
$('.box2').css('background-color', 'pink'); | |
} | |
$('.box1').slideDown(2000) | |
.promise() | |
.done(callbackFn1); | |
$('.box2').slideDown(2000) | |
.promise() | |
.done(callbackFn2()); | |
</script> | |
</body> | |
</html> |
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
.box { | |
display: none; | |
width: 100px; | |
height: 100px; | |
border: 1px solid hotpink; | |
background: white; | |
margin: 10px; | |
} |
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
function callbackFn1() { | |
$('.box1').css('background-color', 'pink'); | |
} | |
function callbackFn2() { | |
$('.box2').css('background-color', 'pink'); | |
} | |
$('.box1').slideDown(2000) | |
.promise() | |
.done(callbackFn1); | |
$('.box2').slideDown(2000) | |
.promise() | |
.done(callbackFn2()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment