Skip to content

Instantly share code, notes, and snippets.

@DannyJoris
Created August 16, 2014 21:21
Show Gist options
  • Save DannyJoris/1e6fb7392f1fcbc3cad0 to your computer and use it in GitHub Desktop.
Save DannyJoris/1e6fb7392f1fcbc3cad0 to your computer and use it in GitHub Desktop.
<!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>
.box {
display: none;
width: 100px;
height: 100px;
border: 1px solid hotpink;
background: white;
margin: 10px;
}
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