Spritefy-Animation is a jQuery plugin to control animations generated by Spritefy
Version 0.5
- Safari 5.1+
- Firefox 11+
- Opera 11.62+
- Chrome 18+
No toy for you IE (Internet Explorer doesn't support css animations)
$(<el>).spritefy(<animation_name>,<options>);
$("#my_el").spritefy("sprite",{duration:1,count:5,onComplete:function(){console.log("completed")}});
-
duration:[number] - Total duration in seconds of the animation (for each iteration)
-
delay:[number] - Delay to start the animation
-
count:[number] || "infinite" - How many times the animation will run, set "infinite" for infinite loop.
After you initialize the spritefy in the element, you will have access to the following methods:
-
animation.play() - Plays the current animation.
$("#my_el").animation.play()
-
animation.pause() - Pauses the current animation.
$("#my_el").animation.pause()
You can set callbacks for the following animation events in the options:
-
onStart - Triggered when the animation starts
$("#my_el").spritefy("sprite",{onStart:startHandle})
-
onIteration - Triggered for each time the animation plays in the loop
$("#my_el").spritefy("sprite",{onIteration:iterationHandle})
-
onComplete - Triggered when the animation ends
$("#my_el").spritefy("sprite",{onComplete:completeHandle})
The CSS3 animation were generate by Spritefy tool.