【发布时间】:2016-01-19 13:56:37
【问题描述】:
我想在我们放置元素时为图表中的对象设置动画。
new joint.dia.Graph().on({
'add': function(cell, collection, opt) {
// Here I want to animate the element while dropped.
}
});
知道如何解决这个问题吗?
【问题讨论】:
我想在我们放置元素时为图表中的对象设置动画。
new joint.dia.Graph().on({
'add': function(cell, collection, opt) {
// Here I want to animate the element while dropped.
}
});
知道如何解决这个问题吗?
【问题讨论】:
需要添加以下代码来为元素设置动画。
cell.transition('position/y',250, {
duration: 200,
timingFunction: function(t) { return t*t; },
valueFunction: function(a, b) {
return function(t) { return a + (b - a) * t }}
});
【讨论】: