use css transform

This commit is contained in:
rolux 2011-04-25 15:26:17 +02:00
parent 808d561a25
commit 5f7f2b38b9

View file

@ -75,6 +75,7 @@ Ox.load.UI = function(options, callback) {
browserSupported ? showIcon() : showWarning();
function showIcon() {
/*
var src = Ox.PATH + 'svg/Ox.UI.' + options.theme + '/symbolLoadingAnimated.svg'
Ox.loadFile(src, function() {
Ox.element('<img>')
@ -90,6 +91,7 @@ Ox.load.UI = function(options, callback) {
})
.appendTo(div);
});
*/
var deg = 0, element, interval,
src = Ox.PATH + 'svg/Ox.UI.' + options.theme + '/symbolLoading.svg'
Ox.loadFile(src, function() {
@ -97,23 +99,21 @@ Ox.load.UI = function(options, callback) {
.attr({
src: src
})
.css({
position: 'absolute',
top: '250px',
left: '500px',
.css(Ox.extend({
width: '32px',
height: '32px'
})
}, css))
.mousedown(function(e) {
e.preventDefault()
})
.appendTo(div);
interval = setInterval(function() {
setTimeout(function rotate() {
deg = (deg + 30) % 360;
element.css({
MozTransform: 'rotate(' + deg + 'deg)',
WebkitTransform: 'rotate(' + deg + 'deg)'
});
Ox.element('OxLoadingScreen')[0] && setTimeout(rotate, 83);
}, 83);
});
}