Jump to content
Search Community

Horizontal scroll issue

Dave Dublin test
Moderator Tag

Recommended Posts

Hi

In a horizontal scroll, is there a setting that stops the previous content from disappearing (continuing to scroll), and having the next block visible while the horizontal scrolling is happening?

 

If I am not making sense, please see the screenshot:

I want the title 'horizontal header" not to disappear when the block are scrolling sideways.

And also for the footer (red) block to be visible. So to look like the screenshot, while the side scroll is happening.

 

The horizontal header block isn't full height, so the page is looking very empty while the horizontal scroll is happening, see last screenshot.

 

Any help would be appreciated

 

Thanks

Dave

Screenshot 2022-09-14 at 19.49.05.png

Screenshot 2022-09-14 at 20.02.55.png

See the Pen bGMBOaV by davedublin (@davedublin) on CodePen

Link to comment
Share on other sites

Thanks Rodrigo

It wasn't exactly what I was looking for, but this should well though thanks.

 

One other question if you don't mind.

Is it possible for the horizontal animation to finish, and continue the normal scroll, when the last just block comes into view.

At the moment the horizontal blocks are half way across, by the time it scrolls down again.

I can't seem to get rid of all that spacing on the right.

See screen shot

Screenshot 2022-09-14 at 23.13.15.png

Link to comment
Share on other sites

Hey Dave,

 

This seems to be working: 

gsap.to(boxes, {
  xPercent: -100 * (boxes.length * 1.1),
  ease: "none",
  scrollTrigger: {
    trigger: ".horizontal_wrap",
    pin: true,
    markers: false,
    scrub: 1,
    snap: 1 / boxes.length,
    start: "top-=40% top",
    end: "+=3000"
  }
});

I updated the code-pen.

 

Another alternative would be the container animation. Here you can check how it works:

 

Happy Tweening!!!

Link to comment
Share on other sites

Hi Rodrigo

 

Thanks for doing that. What I was looking for though was to the vertical scroll to happen just as the last block has entered the viewport.

So for example, when the last below block is visible, the side scroll stops.

 

I think I may have gotten close enough with, just not sure what it all means.

I changed: 

xPercent: -100 * (boxes.length - 1),

to
 xPercent: -100 * (boxes.length - 1.9),

 

Thanks again

 

 

Screenshot-2022-09-15-at-08.42.38.png

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