Walkway.js实现了一个简单的方式用来对包含线和路径元素的SVG图像进行动画展示。
在线演示
示例代码:
// Create a new instancevar svg = new Walkway(options);// Draw when ready, providing an optional callbacksvg.draw(callback);// Options passed in as an object, see options below.var svg = new Walkway({ selector: '#test'});// Overwriting defaultsvar 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');});
评论