我有以下代码:
$(document).ready(function () {
var stage = Snap("#stage");
var shape = stage.rect(0, 0, 100, 100, 11, 11);
var d = 45;
shape.attr({
fill: "#bada55",
stroke: "#000",
strokeWidth: 6
});
function rotation(d) {
shape.animate({
transform: 'r' + d + ',50,50'
},
1000,
mina.bounce,
function () {
d += 45;
if (d > 360) d = 0;
rotation(d);
}
);
}
rotation(d);
});
我想在其旋转内对同一个对象执行平移,以便旋转和平移的缓动同步。
我怎么做?
{ transform: 'r' + d + ',50,50' , 't50,50'},
不起作用。
任何想法?