marcow Posted April 29 Share Posted April 29 I have this error that I see in the chrome console and I don't understand the problem. The gsap-core script and scroll trigger are installed correctly as you can see from the screenshot of the html of the page, I inserted the urls in cdn from the installation page. Opening the js file where I have inserted the gsap code seems not to find Scrollrtrigger plugin. I can't figure out what the problem is. Link to comment Share on other sites More sharing options...
Solution mvaneijgen Posted April 29 Solution Share Posted April 29 Hi @marcow welcome to the forum! From your screenshot I see you load your motion-gsap.js BEFORE all the GSAP scripts. It is recommended too load your own script AFTER all the dependencies you'll need. As a work around you can wrap your custom code in a load listener eg that way you're sure your code gets executed when everything on the page has load. window.addEventListener("load", (event) => { // your code here! }); Hope it helps and happy tweening! 1 Link to comment Share on other sites More sharing options...
marcow Posted April 29 Author Share Posted April 29 9 minutes ago, mvaneijgen said: Hi @marcow welcome to the forum! From your screenshot I see you load your motion-gsap.js BEFORE all the GSAP scripts. It is recommended too load your own script AFTER all the dependencies you'll need. As a work around you can wrap your custom code in a load listener eg that way you're sure your code gets executed when everything on the page has load. window.addEventListener("load", (event) => { // your code here! }); Hope it helps and happy tweening! Thanks!! so it works, I moved my motion-gsap.js code underneath and everything works correctly. 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