This page shows an example of the AnimatedPNG javascript library in action.
The example uses images named fish0001.png
through fish0023.png
.
The animation is initialised with the following code:
fishAnim = new AnimatedPNG('fish', 'fish0001.png', 23, 100);
fishAnim.draw(false);
Click the various links below to alter the behaviour of the animation.
(just to prove it’s a PNG with transparency)
document.getElementById('fishAnimDiv').style.backgroundColor = '#<color>';
fishAnim.stopAnimation();
fishAnim.startAnimation();
fishAnim.setRepeat(false);
fishAnim.setRepeat(true);
fishAnim.setFrameDelay(3, 500);
fishAnim.setFrameDelay(15, 500);
fishAnim.clearFrameDelays();