<!DOCTYPE html>
<html>
<title>test animation</title>
<!--https://github.com/airbnb/lottie-web/tree/v5.6.9/build/player/lottie.min.js-->
<script src="./lottie.min.js"></script>
<style>
#container, #container1{
width: 200px;
height: 200px;
}
</style>
<body>
<div id="container"></div>
<div id="container1"></div>
</body>
</html>
<script>
window.onload = animate_path;
//path路径加载
function animate_path() {
let animation = lottie.loadAnimation({
container: document.getElementById('container'),
renderer: 'svg',
loop: true,//循环加载
autoplay: true,//自动播放
path: './gatin/data.json',//如果没有图片做动效,全是设计师用画的矢量图形
})
animate_animationData();
}
//json数据加载
lottie web动画加载
最新推荐文章于 2025-03-11 21:51:30 发布