我在SVG中有轮盘赌和球。轮盘旋转,我想围绕轮盘赌中心旋转球。但它围绕其他点旋转。如何围绕轮盘中心旋转?
var bbox = ballg.getBBox(); //bounding box, get coords and centre
var scale = 2.85;
var off = 10;
ballAnimation(bbox.cx + off, bbox.cy + off, 3000, scale);
function ballAnimation(cx, cy, speed, scale){
ballg.attr({ transform: 'r0 ' + cx + ' ' + cy + " s" + scale + "," + scale + "," + cx + "," + cy }); //Reset + Scale setup
ballg.stop(true).animate(
{ transform: "r360," + cx + ',' + cy + " s" + scale + "," + scale + "," + cx + "," + cy },
speed,
function(){
ballAnimation(cx,cy, speed, scale);
}
);
}
When Documents Become Databases – Tabulizer R Wrapper for Tabula PDF Table Extractor