Created
February 10, 2014 14:33
-
-
Save horacioh/8916967 to your computer and use it in GitHub Desktop.
add class to animate and remove class onAnimationEnd. Took it from http://daneden.github.io/animate.css/
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
/*dependency on animate.css | |
#animationSandbox = element to be animated | |
.js--triggerAnimation = button to animate element | |
.js--animations = input select with animations | |
*/ | |
function testAnim(x) { | |
$('#animationSandbox').removeClass().addClass(x + ' animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){ | |
$(this).removeClass(); | |
}); | |
}; | |
$(document).ready(function(){ | |
$('.js--triggerAnimation').click(function(){ | |
var anim = $('.js--animations').val(); | |
testAnim(anim); | |
}); | |
$('.js--animations').change(function(){ | |
var anim = $(this).val(); | |
testAnim(anim); | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment