I'm trying to create a bounce animation that repeats forever. Problem I'm having is that snap doesn't seem to execute animations I put in callbacks. There seem to be some issues on github describing this problem with Snap back at 0.1.1, but they've since been closed. Has anyone else see anything like this?
Current code, which will run the first part of the animation and then stop:
var slight_bounce = function(body_part, transform1, transform2){
body_part.stop().animate({
transform: transform1
}, 1000,
function() {
body_part.animate({
transform: transform2
});
slight_bounce(body_part, transform1, transform2); // Repeat this animation so it appears infinite.
}
);
}
slight_bounce(hat, bounce, bounce_back);