Jump to content
Search Community

Horizontal scroll jumping when using element scroller

lhug test
Moderator Tag

Recommended Posts

Hi there,

I’m having an issue implementing a design where a vertical scroll transitions to a horizontal. The sticky horizontal scroll section is jumping when the transition happens. I have done a similar setup that doesn‘t include scroller: ".outer" where it does not occur, how ever this content will be loaded in a modal and from what I have ready I need to use scroller so it is not connected to the body container.

You will see the first image jump upwards when rapidly scrolling. It seems to occur more on the first and last couple images. Any help would be greatly appreciated.

See the Pen LYvoPzp by leightonhughes (@leightonhughes) on CodePen

Link to comment
Share on other sites

Hi @lhug and welcome to the GSAP Forums!

 

I read your post a few times and looked at your demo, but I can't seem to understand what exactly is the problem you're having, maybe I'm missing something obvious here 🤷‍♂️

 

It'd be great if you could expand a little more on this and share more details about what is happening and how.

 

This is what I'm seeing when I run your codepen demo:

https://i.imgur.com/OIzbadZ.mp4

 

Then when I use the mouse wheel I can't see anything unusual or wrong.

 

Happy Tweening!

Link to comment
Share on other sites

Hi @Rodrigo, thanks for getting in touch. When you scroll my codepen you should see the images jump upwards for a split second when the horizontal transition takes place. If you scroll fast it is more noticeable.

Link to comment
Share on other sites

Sorry still can see anything. This is a screen recording on my desktop, for the first 8 seconds I'm pressing start and end like a lunatic in order to quickly scroll to the top and bottom, then I'm using page up/down and I can't see anything wrong:

https://i.imgur.com/hrIKv8t.mp4

 

Can you see the same behaviour in this recording as you see it in your setup? Again, maybe I'm seeing something normal that is not and totally missing the point here 🤷‍♂️

Link to comment
Share on other sites

Yeah I can't see that on my desktop/laptop (Ubuntu 22 & 20) on the latest firefox and chrome.

 

The only thing I can suggest you is to try ScrollTrigger's normalizeScroll method and pass that scroller element as the target:

https://gsap.com/docs/v3/Plugins/ScrollTrigger/static.normalizeScroll()

ScrollTrigger.normalizeScroll({
  allowNestedScroll: true,
  target: ".outer"
});

Try that and let us know how it goes.

 

Happy Tweening

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