Created
November 8, 2010 12:16
-
-
Save benbarnett/667636 to your computer and use it in GitHub Desktop.
demo code on jquery anim enhanced plugin home
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
$('button#start').click(function() { | |
var results = $('p#results').html("Animating..."), | |
button = $(this).attr('disabled', 'disabled'); | |
// CSS3 Container | |
$('.target-css').animate({left: "+=200px", width:320 }, 1500, function() { | |
results.html('first callback() fired, reversing...'); | |
$(this).animate({left: "-=200px", width:280 }, 1500, function() { | |
results.html("second callback() fired"); | |
button.removeAttr('disabled'); | |
}); | |
}); | |
// CSS3 Container (leaveTransforms) | |
$('.target-css-leave').animate({left: "+=200px", width:320, leaveTransforms:true }, 1500, function() { | |
$(this).animate({left: "-=200px", width:280, leaveTransforms:true }, 1500); | |
}); | |
// DOM container | |
$('.target-dom').animate({left: "+=200px", width:320, avoidTransforms:true }, 1500, function() { | |
$(this).animate({left: "-=200px", width:280, avoidTransforms:true }, 1500); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment