Flying Kid Posted August 29, 2020 Share Posted August 29, 2020 Hello, Does someone see why the scrollTrigger doesn't work on my page. www.ppgames.fr/accueil-new thank you ! See the Pen zYqzYPa by Flying-kid (@Flying-kid) on CodePen Link to comment Share on other sites More sharing options...
GreenSock Posted August 29, 2020 Share Posted August 29, 2020 If you open the console on your web page, you'll see that there are a ton of errors being thrown. Uncaught TypeError: a.target.className.indexOf is not a function That's not anything related to GSAP. The problem with your CodePen is that you nested the scrollTrigger inside the motionPath object. //BAD gsap.to("#bee", { duration:2, motionPath: { path:"#cpath", align:"#cpath", alignOrigin:[0.5, 0.5], autoRotate:true, scrollTrigger: "#bee" } }); // GOOD gsap.to("#bee", { duration:2, scrollTrigger: "#bee" motionPath: { path:"#cpath", align:"#cpath", alignOrigin:[0.5, 0.5], autoRotate:true } }); Also, your code is just telling it to play your animation when "#bee" enters the viewport, but you've got it at the top of your page so that basically means it's always gonna play right away (I see no purpose in even adding a scrollTrigger like that). 2 Link to comment Share on other sites More sharing options...
Flying Kid Posted August 29, 2020 Author Share Posted August 29, 2020 Thank you ! problem solved ! i added a spacing bar to simulate the future content that will be added. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now