I’m making a simple animation with js. My animation is done simply by changing a picture 13 times per second. I have implemented the animation in two very simple manners.
The first implementation is using a simple img tag and replacing the src attribute each time.
The second implementation is using canvas and drawing the current image each time.
I’m not sure which one is better.. I tend to go with the first implementation since it will work on browsers that doesn’t support html5 but I’m not sure if there is a performance benefit by doing this with canvas.
Please add an explanation to your answer.
Changing the source should be the most efficient, given you’re pre-loading the images.