diff --git a/source/Ox.UI/js/Core/Ox.LoadingIcon.js b/source/Ox.UI/js/Core/Ox.LoadingIcon.js index 3cfaa732..5e27f49e 100644 --- a/source/Ox.UI/js/Core/Ox.LoadingIcon.js +++ b/source/Ox.UI/js/Core/Ox.LoadingIcon.js @@ -30,16 +30,20 @@ Ox.LoadingIcon = function(options, self) { () -> 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;