I don't know much about this programming, so can someone help me? Now open the web page, it will automatically play the animation. I want it to play 5 seconds after I open the webpage, how should I modify this code:
var animation = bodymovin.loadAnimation({
container: document.getElementById('glint'),
renderer: 'svg',
loop: false,
autoplay: true,
path: 'img/lottie/glint.json'
})
setTimeout(() => {
var animation = bodymovin.loadAnimation({
container: document.getElementById('glint'),
renderer: 'svg',
loop: false,
autoplay: true,
path: 'img/lottie/glint.json'
})
}, 5000)
I am not aware of delaying the animation programmatically but i have a workaround. you can keep an image placeholder for the lottie file(screenshot of lottie maybe) and replace it with lottie when you have to start the animation.