Tweenmax starts animation without waiting for ScrollMagic

I'm trying to get scrollmagic to trigger a TweenMax animation, but the animation starts without waiting for the scroll trigger to fire. Did I miss something?

$(document).ready(function($) {
  var controller = new ScrollMagic();

  var tween = TweenMax.to('.animateme', 1, {color: "green", scale: 2.5});

  var scene = new ScrollScene({triggerElement: '.trigger'})
    .setTween(tween)
    .addTo(controller);
  scene.addIndicators({zindex: 100});
});

      

+3


source to share


1 answer


It turns out if you have to enable the ScrollMagic AFTER, including TweenMax, otherwise the animation animation will just start and ignore the scrolling.



+6


source







All Articles