update loading icon
This commit is contained in:
parent
4b454790d5
commit
e5b46da0d5
1 changed files with 10 additions and 6 deletions
|
@ -30,16 +30,20 @@ Ox.LoadingIcon = function(options, self) {
|
|||
() -> <f> Loading Icon Element
|
||||
@*/
|
||||
that.start = function() {
|
||||
var deg = 0;
|
||||
var css, deg = 0, previousTime = +new Date();
|
||||
if (!self.loadingInterval) {
|
||||
self.loadingInterval = setInterval(function() {
|
||||
deg = (deg + 30) % 360;
|
||||
var currentTime = +new Date(),
|
||||
delta = (currentTime - previousTime) / 1000;
|
||||
previousTime = currentTime;
|
||||
deg = Math.round((deg + delta * 360) % 360 / 30) * 30;
|
||||
css = 'rotate(' + deg + 'deg)';
|
||||
that.css({
|
||||
OTransform: 'rotate(' + deg + 'deg)',
|
||||
MozTransform: 'rotate(' + deg + 'deg)',
|
||||
WebkitTransform: 'rotate(' + deg + 'deg)'
|
||||
OTransform: css,
|
||||
MozTransform: css,
|
||||
WebkitTransform: css
|
||||
});
|
||||
}, 83)
|
||||
}, 83);
|
||||
that.animate({opacity: 1}, 250);
|
||||
}
|
||||
return that;
|
||||
|
|
Loading…
Reference in a new issue