Walkway.js线和路径元素动画
Walkway.js 实现了一个简单的方式用来对包含线和路径元素的 SVG 图像进行动画展示。
示例代码:
// Create a new instance var svg = new Walkway(options); // Draw when ready, providing an optional callback svg.draw(callback); // Options passed in as an object, see options below. var svg = new Walkway({ selector: '#test'}); // Overwriting defaults var svg = new Walkway({ selector: '#test', duration: '2000', // can pass in a function or a string like 'easeOutQuint' easing: function (t) { return t * t; } }); svg.draw(); // If you don't want to change the default options you can // also supply the constructor with a selector string. var svg = new Walkway('#test'); svg.draw(function () { console.log('Animation finished'); });
评论