Created
March 14, 2015 21:56
-
-
Save wiledal/9705637fc44657ec97e7 to your computer and use it in GitHub Desktop.
Simple shake animation for TweenMax (gsap.js). For modern form error feedback.
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 shakeAnimation(element){ | |
TweenMax.to(element, .1, { | |
x: -7, | |
ease: Quad.easeInOut | |
}); | |
TweenMax.to(element, .1, { | |
repeat: 4, | |
x: 7, | |
yoyo: true, | |
delay: .1, | |
ease: Quad.easeInOut | |
}); | |
TweenMax.to(element, .1, { | |
x: 0, | |
delay: .1 * 4 | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment