admin管理员组文章数量:1026062
Ok so I just started using bodymovin and was wondering if there was a way for me to delay the animation.
My web page fades in so during that fade in the animation is happening which is not what i would like. So if I could delay it by 2 seconds that would be great.
Here is my code:
var animation = bodymovin.loadAnimation({
container: document.getElementById('bm'),
renderer: 'svg',
loop: false,
autoplay: true,
path: 'data.json'
})
I have tried to use setTimeout but I have not been able to get it to work.
Ok so I just started using bodymovin and was wondering if there was a way for me to delay the animation.
My web page fades in so during that fade in the animation is happening which is not what i would like. So if I could delay it by 2 seconds that would be great.
Here is my code:
var animation = bodymovin.loadAnimation({
container: document.getElementById('bm'),
renderer: 'svg',
loop: false,
autoplay: true,
path: 'data.json'
})
I have tried to use setTimeout but I have not been able to get it to work.
Share Improve this question asked Sep 23, 2018 at 2:01 ethanfox27ethanfox27 8971 gold badge11 silver badges28 bronze badges1 Answer
Reset to default 4You could set the autoplay
value to false
, and call play()
in a timeout of 2000ms. I'm assuming you're using the library found here.
var animation = bodymovin.loadAnimation({
container: document.getElementById('bm'),
renderer: 'svg',
loop: false,
autoplay: false,
path: 'data.json'
})
setTimeout(function(){ animation.play(); }, 2000);
Ok so I just started using bodymovin and was wondering if there was a way for me to delay the animation.
My web page fades in so during that fade in the animation is happening which is not what i would like. So if I could delay it by 2 seconds that would be great.
Here is my code:
var animation = bodymovin.loadAnimation({
container: document.getElementById('bm'),
renderer: 'svg',
loop: false,
autoplay: true,
path: 'data.json'
})
I have tried to use setTimeout but I have not been able to get it to work.
Ok so I just started using bodymovin and was wondering if there was a way for me to delay the animation.
My web page fades in so during that fade in the animation is happening which is not what i would like. So if I could delay it by 2 seconds that would be great.
Here is my code:
var animation = bodymovin.loadAnimation({
container: document.getElementById('bm'),
renderer: 'svg',
loop: false,
autoplay: true,
path: 'data.json'
})
I have tried to use setTimeout but I have not been able to get it to work.
Share Improve this question asked Sep 23, 2018 at 2:01 ethanfox27ethanfox27 8971 gold badge11 silver badges28 bronze badges1 Answer
Reset to default 4You could set the autoplay
value to false
, and call play()
in a timeout of 2000ms. I'm assuming you're using the library found here.
var animation = bodymovin.loadAnimation({
container: document.getElementById('bm'),
renderer: 'svg',
loop: false,
autoplay: false,
path: 'data.json'
})
setTimeout(function(){ animation.play(); }, 2000);
本文标签: javascriptHow Do I Delay a Bodymovin AnimationStack Overflow
版权声明:本文标题:javascript - How Do I Delay a Bodymovin Animation - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745630078a2160106.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论