Jump to content
Search Community

Scroll Trigger Horizontal Speed

ferriss test
Moderator Tag

Go to solution Solved by ZachSaucier,

Recommended Posts

Hi,

 

I've using the above pen, however I have different lengths of content through-out the website.

 

This causes the scroll to scroll horizontal really fast on longer content over short. 

 

Is there a way of keeping the scroll speed consistent regardless of content width?

 

You can replicate this by using 3 child divs in the example and then changing this to 9, you will see a difference in speed.

 

Thanks,

Ferriss.

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

Link to comment
Share on other sites

  • 2 years later...

hi Rodrigo, thanks for replying 

I managed to fix it with "end" property

 

 

    let scrollTween = gsap.to(panels, {
        xPercent: -100 * (panels.length - 1),
        ease: "none",
        scrollTrigger: {
            trigger: ".WbContainer__Scroll_Hr",
            pin: true,
            scrub: 1, //scrollSmoothness and delay
            end: "+=" + panels.length * 3000, //speed of scroll
        }
    })

 

so with this I would have a scalable scroll speed based on the quantity of my slides

 

before this my scroll space was generated automatically with the "pin" bottom padding

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