Jump to content
Search Community

Issue with ScrollTrigger after an install via Yarn

matlstria test
Moderator Tag

Go to solution Solved by OSUblake,

Recommended Posts

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

  • Solution

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'
})

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...