代码
$('.success-info-title').append('<p class="normal_finish" id="normal_finish_anima" > </p>');
var animaPaht = data.changeSkinFlag&&data.changeSkinFlag == 'midAutumnSkin' ? '/pay/js/biz/midAutumnNomrmalAnimaData.json': '/pay/js/biz/normalUserFinishAnimaData.json';
window.Ariel.JSLoader.load('/pay/js/biz/lottie_svg.js', function () {
var animation = bodymovin.loadAnimation({
container: document.getElementById('normal_finish_anima'),
renderer: 'svg',
loop: false,
autoplay: true,
path: animaPaht
});
setTimeout(function () { // 动画延迟播放
animation.play();
}, 200);
});
|
引入文件
注意
不能对已经存在的html添加lottie动画