Look at this cool sprite I discovered!
.common-spinner.common-spinner-40x55 {
height: 55px;
width: 40px;
}
.common-spinner {
background: url("images/loading-sprite.png") no-repeat scroll 100% 100% transparent;
}
<div class="loading">
<div class="common-spinner common-spinner-40x55" style="background-position: 0px 0px;"></div>
</div>
Has anyone figured out how to create a loading animation using this? I attempted to change the position in a for loop like this:
for(i=0; i<=720;) {
$('.common-spinner').css('background-position', '-'+i+'px 0px');
i=i+20;
}
However, there seems to be no animation. Could it be moving too quickly?
Any suggestions on how to make this work?
Best,
I have shared the code on jsfiddle with Erik Hesselink's solution