Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这个问题是特定于命运之轮的例子。作为 javascript 的新手,我设法更改了楔形的数量、颜色和标签,但我无法将函数绑定到旋转动画的结束事件。这将是一个关于冒险行为的小型心理学实验,我需要确定在轮换结束时哪个楔子达到了标记。
这直接来自 Konva JS 文档...
// the tween has to be created after the node has been added to the layer var tween = new Konva.Tween({ node: wheel, duration: 4, rotation: 360, easing: Konva.Easings.BackEaseOut, onFinish: function() { writeMessage('tween finished!'); } });
Konva JS Tween 完成事件