extremed
7 Dec 2011, 10:45 AM
Hi
Im trying to animate a loading indicator with a image sprite
29872
.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" id="common-spinner" style="background-position: 0px 0px;"></div>
</div>
so i tried something like this
function setBgPosition ()
{
var loader_positions = ['0', '-120', '-240', '-360', '-480', '-600', '-720'];
Ext.Array.each(loader_positions, function(name, index) {
Ext.get('common-spinner').setStyle('background-position', name + 'px 0px');
});
}
so the problem is its seems to ge going too fast, so i understand i have to slow down the speed while set position css inside ext each
any idea how to do this correctly? below there is a example built with jquery.
http://jsfiddle.net/X7tGb/2/
sorry fot the bad english.
Regards
Im trying to animate a loading indicator with a image sprite
29872
.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" id="common-spinner" style="background-position: 0px 0px;"></div>
</div>
so i tried something like this
function setBgPosition ()
{
var loader_positions = ['0', '-120', '-240', '-360', '-480', '-600', '-720'];
Ext.Array.each(loader_positions, function(name, index) {
Ext.get('common-spinner').setStyle('background-position', name + 'px 0px');
});
}
so the problem is its seems to ge going too fast, so i understand i have to slow down the speed while set position css inside ext each
any idea how to do this correctly? below there is a example built with jquery.
http://jsfiddle.net/X7tGb/2/
sorry fot the bad english.
Regards