你好,有人可以解释一下为什么我的动画会中断吗?所以我有这个圈子基本上遵循一条路径,因为彼此之上我需要一种方法来为每一个添加延迟,以便它们在屏幕上正确显示。
var test = svgContainer.selectAll('.test')
.data(testData)
.attr("r", 10)
.attr("transform", "translate(" + testData[0].x + "," +
testData[0].y + ")");
var transitionFrom = test;
for (var i = 1; i < testData.length; i++) {
transitionFrom = transitionFrom.transition()
.duration(testData[i].speed)
.ease("linear")
.attr("transform", "translate(" + testData[i].x + "," +
testData[i].y + ")");
}
每当我尝试添加像这样的.delay()时
var transitionFrom = test;
for (var i = 1; i < testData.length; i++) {
transitionFrom = transitionFrom.transition()
.duration(testData[i].speed)
**.delay(something here)**
.ease("linear")
.attr("transform", "translate(" + testData[i].x + "," +
testData[i].y + ")");
}
我的动画片断了。