matlstria Posted March 18, 2022 Share Posted March 18, 2022 Hi, I'm currently having a problem with using ScrollTrigger, after installing gsap through yarn. The installation went well (yarn add gsap), and GSAP is working well. The version is 3.9.1. However, when I add the scrollTrigger property (see the code below), it doesn't work.I don't understand why because in the past when I used version 3.6.1 via CDN, this same code worked. Can someone help me? /* * GSAP */ import { gsap } from "gsap"; import { ScrollTrigger } from "gsap/ScrollTrigger"; gsap.registerPlugin(ScrollTrigger); // Exemple gsap.from('footer', { opacity: 0, duration: 2, scrollTrigger: 'footer' }) Link to comment Share on other sites More sharing options...
Solution OSUblake Posted March 18, 2022 Solution Share Posted March 18, 2022 Welcome to the forum @matlstria There is a known regression with ScrollTrigger from animations, which will be fixed in the next version. In the meantime, please add lazy: false to your from animations. gsap.from('footer', { opacity: 0, duration: 2, lazy: false, scrollTrigger: 'footer' }) 1 1 Link to comment Share on other sites More sharing options...
matlstria Posted March 18, 2022 Author Share Posted March 18, 2022 Thank you @OSUblake Problem resolved 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