I'm trying to get scrollmagic to trigger a TweenMax animation, but the animation starts without waiting for the scroll trigger to be hit. Am I missing something here?
$(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});
});
It turns out, if you must include ScrollMagic AFTER including TweenMax, otherwise the tween animation will just run and ignore scrolling.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With