I have a sprite containing images in a line which are identical except each image is rotated 40degrees more than the previous image. Is it possible to use jQuery with sprites so that the background position of a div changes after a delay.
I’ve been messing about with some code but with no success.
You’d want to do something like this:
var timeInMS = 100;
var pos = 0;
setInterval(function() {
$('.moveMe').css({'background-position: ' + pos + 'px 0'});
pos += 40;
}, timeInMS);