You need to use canvas and javascript elements to create animations, and then change the images when some actions are detected.
HTML:
<canvas id="#test" data-url="...url..."></canvas>
JQuery
$(document).ready(function(){ $('#test').each(function(index, element){ var obj = $(this); var canvas = $(this)[0]; var context = element.getContext('2d'); var img = new Image(); img.src = $(this).data('url'); img.onload = function () { context.drawImage(img, 0, 0); }; $(this).on({ "mouseover" : function() { canvas.width = canvas.width; context.drawImage(img, img.width / 2,0,img.width / 2,img.height,0,0,img.width / 2,img.height); }, "mouseout" : function() { canvas.width = canvas.width; context.drawImage(img, 0, 0); } }); });
In this example, a 2 horizontal sprite of the image is loaded, and when you move the image that it changes from the first half to the second half, for your application you need to download a lot of sprites, and then change them
you can also use jquery plugins to create animations like http://spritely.net/
Chico3001
source share