Walkway.js
11月23日开源中国源创会年度(北京万豪酒店)千人盛典正在报名中
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');});