Zilli Posted February 1, 2021 Share Posted February 1, 2021 Hi, I have been using gsap tweens in my project using the full member minified version of Gsap and it has been working fine. I wanted to use the ScrollTrigger plug-in to time an animation on scroll and followed the tutorial on that but it already shows ScrollTrigger as unidentified. I know the minified version is working since i'm using it for other elements. For testing purposes I added the register and the tween in a separate js file and linked it in the html file. I register the plugin at the beginning of my script file as such: /* gsap plugins */ gsap.registerPlugin(ScrollTrigger); and at the end of the document adding the gsap tween: gsap.from("#section-2", { ScrollTrigger: "#section-2" rotation: 15, y: 15, duration: 0.5 }), I thought that the ScrollTrigger plug-in was added in the full version? Thanks Link to comment Share on other sites More sharing options...
Solution mvaneijgen Posted February 1, 2021 Solution Share Posted February 1, 2021 ScrollTrigger is a different file you need to load. Take a look at https://greensock.com/docs/v3/Installation to help you install all the correct files for what you want to use 3 Link to comment Share on other sites More sharing options...
Zilli Posted February 1, 2021 Author Share Posted February 1, 2021 15 minutes ago, mvaneijgen said: ScrollTrigger is a different file you need to load. Take a look at https://greensock.com/docs/v3/Installation to help you install all the correct files for what you want to use Ah okay. Ik thought that everything was included. Thanks so much for clarifying! Link to comment Share on other sites More sharing options...
elegantseagulls Posted February 1, 2021 Share Posted February 1, 2021 1 hour ago, Zilli said: gsap.from("#section-2", { ScrollTrigger: "#section-2" rotation: 15, y: 15, duration: 0.5 }), Also, when using ScrollTrigger inside of a gsap object/timeline you want to camelCase it: gsap.from("#section-2", { scrollTrigger: "#section-2", rotation: 15, y: 15, duration: 0.5 }). You're also missing a comma after your ScrollTrigger selector. 3 Link to comment Share on other sites More sharing options...
Zilli Posted February 1, 2021 Author Share Posted February 1, 2021 3 minutes ago, elegantseagulls said: Also, when using ScrollTrigger inside of a gsap object/timeline you want to camelCase it: gsap.from("#section-2", { scrollTrigger: "#section-2", rotation: 15, y: 15, duration: 0.5 }). You're also missing a comma after your ScrollTrigger selector. Thank you for noticing. I indeed saw that and corrected it. It's working perfect now. 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