javascript - How Do I Delay a Bodymovin Animation - Stack Overflow

Ok so I just started using bodymovin and was wondering if there was a way for me to delay the animation

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 badges
Add a ment  | 

1 Answer 1

Reset to default 4

You 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);

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745630079a4637051.html

相关推荐

  • javascript - How Do I Delay a Bodymovin Animation - Stack Overflow

    Ok so I just started using bodymovin and was wondering if there was a way for me to delay the animation

    12小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信