【问题标题】:how to animate drop a element in paper using jointjs如何使用jointjs为纸张中的元素设置动画
【发布时间】: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.
    }

});

知道如何解决这个问题吗?

【问题讨论】:

    标签: jquery jointjs


    【解决方案1】:

    需要添加以下代码来为元素设置动画。

    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 }}
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-15
      相关资源
      最近更新 更多