Jump to content
Search Community

ScrollTrigger actions sometimes never called after a resize

benrbnt test
Moderator Tag

Recommended Posts

Hello, I have an issue I can't manage trop reproduce in a simple codepen (available here: ) but as a demo, here is a video where the "bug" occurs.

 

I don't have any specific ScrollTrigger configuration. My ScrollTrigger config in the video is the exact same one as the one in the codepen.

 

I use Lenis, added it in the Codepen too, and it looks like it is not the issue here :( 

 

 

See the Pen QWZJEEQ?editors=1111 by benjaminrobinet (@benjaminrobinet) on CodePen

Link to comment
Share on other sites

Hi,

 

What is exactly the issue we should be looking at? You didn't describe what's the problem in the video.

 

Finally as you mention in Codepen everything works as expected. The demo is using the latest version of GSAP and ScrollTrigger. Be sure to use 3.11.5 in your development environment, for the GSAP Core and any Plugin you're using.

 

Happy Tweening!

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

I just checked your codepen and after a resize everything works as expected. I keep seeing all the callbacks there, maybe I'm missing something 🤷‍♂️

 

There could be something else in your setup that's causing this, unfortunately a video doesn't tell us the whole story and as stated before your codepen is working as expected.

 

One alternative could be to test next release's beta files:

https://assets.codepen.io/16327/gsap-latest-beta.min.js

https://assets.codepen.io/16327/ScrollTrigger.min.js

 

Give those a try and let us know.

Hopefully this helps.

Happy Tweening!

Link to comment
Share on other sites

@Rodrigo I might have a guess for the issue: I use gsap matchMedia scope for my ScrollTriggers, so when I resize, sometimes the ScrollTrigger is re-created then the action of the previously created ScrollTrigger won't be called.

 

As a fix, in my case I could just use the cleanup function of the scope.

 

Sorry for not having been clear enough. Thanks for your help :) 

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...