Response title
This is preview!
var svg = $('#svgphone').svg('get');
var cx = eval($('#img', svg.root()).attr('width'))/2;
var cy = eval($('#img', svg.root()).attr('height'))/2;
r = 45;
var rr = r + ", " + cx + ", " + cy;
$('#img', svg.root()).attr('transform', 'rotate(' + rr + ')');
Now if I apply another attribute for scaling like this:
var svg = $('#svgphone').svg('get');
myScale = 101;
$('#img', svg.root()).attr('transform', 'scale(' + myScale + ')') ;
The previously applied attribute gets reset. Why?
If you are going to vary the same transformations often you might need to attach a data object to the element to keep track of the current settings.
© 2013 jQuery Foundation
Sponsored by and others.