$(element).animate(
{
scale: 1,
centerX: -(this.chartObj.model.m_AreaBounds.Width /2),
centerY:-(this.chartObj.model.m_AreaBounds.Height /2)
},
{
duration: 2000,
step: function(now,fx) {
var scaleVal, x, y;
if (fx.prop == "scale") {
scaleVal = now;
x = 0;
y = 0;
} else if (fx.prop == "centerX") {
x = now;
y = 0;
scaleVal = 0;
}
else if (fx.prop == "centerY") {
x = 0;
y = now;
scaleVal = 0;
}
$(element).attr("transform", "translate("+x*(scaleVal-1)+","+(y*scaleVal-1)+")scale(" + now + ")");
}
}
);
在 step 函数中,prop 值将逐步出现(即,首先scale
,然后centerX
,然后centerY
)。我想使用 CSS 转换属性设置所有这些值,即。我想一步获得所有属性值。