1
0
Fork 0
forked from 0x2620/oxjs

test performance of svg transform vs css transform

This commit is contained in:
rolux 2011-04-25 15:06:26 +02:00
commit 808d561a25
4 changed files with 80 additions and 38 deletions

View file

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