magr0s / vue-scrollmagic

Vue.js plugin
MIT License
72 stars 24 forks source link

How to add a timeline? #12

Closed dacxjo closed 4 years ago

dacxjo commented 4 years ago

I'm trying to add a timeline as a tween but it's not working as expected, the tween executes at load, and in the console show this error:

(ScrollMagic.Scene) -> (animation.gsap) -> ERROR calling method 'setTween()': Supplied argument is not a valid TweenObject

This is my code:

 const timeline = new TimelineMax()
      timeline.to('#navbar', 1, { x: 100 })
      const scene = this.$scrollmagic
        .scene({
          triggerElement: '#intro',
          triggerHook: 0.5,
          duration: 300
        })
        .setTween(timeline)

      this.$scrollmagic.addScene(scene)