Created
August 21, 2012 12:14
-
-
Save webfella/3414996 to your computer and use it in GitHub Desktop.
Wobble function
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
# small function to use with jquery to shake an element. | |
shakeThatBooty = (e, amount, counter) -> | |
speed = 50 | |
if (counter == 0) then return | |
e.animate | |
right: amount | |
, speed, -> | |
e.animate | |
right: -amount | |
, speed, -> | |
shakeThatBooty e, amount, counter-1 | |
return | |
return | |
return | |
shakeThatBooty $(element), 2, 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Best function name!