Created
July 4, 2012 11:04
-
-
Save Ahrengot/3046767 to your computer and use it in GitHub Desktop.
Simple "pump" animation using a Greensock timeline ... Pump it!
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
// Pump it! | |
(function() { | |
var $el = $('#logo'), // <-- Change to whatever | |
canPump = true, | |
pumpTL = new TimelineLite({ | |
paused: true, | |
onStart: function() { canPump = false; }, | |
onComplete: function() { canPump = true; } | |
}); | |
pumpTL.to($el, 0.08, {css:{scale: 1.03}}); | |
pumpTL.to($el, 0.18, {css:{scale: 1}}); | |
pumpTL.to($el, 0.1, {css:{scale: 1.05}}); | |
pumpTL.to($el, 0.4, {css:{scale: 1}}); | |
$el.on('mouseenter', function() { | |
if (!canPump) return; | |
pumpTL.restart(); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment