Jump to content
Search Community

scrollTrigger markers: true

tyte test
Moderator Tag

Recommended Posts

Hi!

I have a question about a strange problem that I encounter with markers in scrollTrigger plugin.

When I use "markers: true" everything works just fine. When I remove them, nothing works. No errors in the console appear.

 

Sorry for not providing demo, I will try to add one if you can't help me without it.

 

Link to comment
Share on other sites

  • 2 years later...

Thank you Rodrigo for your reply !

There are still some issues : in your example the scroll stops at card 7 while there are 8 blocs (in the codepen preview), and there is a "dead scroll zone" at the end where nothing happens.

 

I want the scroll to fit perfectly with the #carousel regardless of the size of the viewport 😅  It fits with markers = true so I guess it is doable without having to change the css at all.

Link to comment
Share on other sites

Hi,

 

Actually there are all visible both in the embedded example and the live one:

BEqZuKS.png

 

0RHVei1.png

 

The reason for having some extra or dead scroll is because you have an end point for the ScrollTrigger instance of +=2000 pixels, so the viewport need at least 2000 pixels of scrolling plus the height of the viewport, which is variable. On top of that you have a fixed element.

 

Honestly is better to use ScrollTrigger's pin option and not trouble yourself with all that:

See the Pen dyqKMzE by GreenSock (@GreenSock) on CodePen

 

Hopefully this helps.

Happy Tweening!

  • Like 2
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...