Animation: http://codepen.io/leongaban/pen/wJAip
If you click the Animate Down button the jQuery will add the .animateDown
class to the spinner. The spinner will then animate down to 0, but then pop back up to fullsize again.
How would you add a new keyframe at the end in CSS to hide the spinner after it shrinks?
Or
In jQuery would would I listen for when the spinner is scaled down to 0 then hide() it?
CSS:
.animateDown {
-webkit-animation: animateDown .3s ease-in-out;
animation: animateDown .3s ease-in-out;
}
@-webkit-keyframes animateDown {
0% {
-webkit-transform: scale(1);
transform: scale(1);
}
100% {
-webkit-transform: scale(0);
transform: scale(0);
}
}
jQuery:
$('#animate-down').unbind('click').bind('click', function() {
$('#spinner').removeClass('animateUp');
$('#spinner').addClass('animateDown');
});