janpaepke / ScrollMagic

The javascript library for magical scroll interactions.
http://ScrollMagic.io
Other
14.88k stars 2.17k forks source link

Scrollmagic event fired on load of page, instead of on scroll #900

Open rakeshreddykatielli opened 5 years ago

rakeshreddykatielli commented 5 years ago

I am trying to implement scrollmagic to a web component. when i tried adding the rotate animation, the event is triggered on load of page instead of on scroll. below is the code i have used in js. Please help to resolve this. Thanks in advance.

Also when am trying to add indicators for the debug , the animationis not working at all.

$(function() {

var scrollMagicController = new ScrollMagic.Controller();

var tween = TweenMax.to(".scroll4", 2, {rotation: 360});

var scene = new ScrollScene.Scene({ triggerElement: ".scroll4",

}) .setTween(tween) .addTo(scrollMagicController);

// Add debug indicators fixed on right side scene.addIndicators();

});

itskhagendra commented 5 years ago

you don't need jquery for scrollmagic 2.0