
地址链接
https://github.com/CCharlie-xiu/lottie-tag
安装
- 安装lottie-web
- lottie-web的基本用法
1 2 3 4 5 6 7
| const animation = lottie.loadAnimation({ container: document.getElementById('domId'), renderer: 'svg', loop: true, autoplay: true, animationData: })
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| animation.play();
animation.stop();
animation.pause();
animation.goToAndStop(value, isFrame);
animation.goToAndPlay(value, isFrame);
animation.goToAndStop(30, true);
animation.goToAndPlay(300);
animation.playSegments(arr, forceFlag);
animation.playSegments([10,20], false);
animation.playSegments([[0,5],[10,18]], true);
animation.setSpeed(speed);
animation.setDirection(direction);
animation.destroy();
|
Lottie 网站
https://lottiefiles.com/
