Jump to content
Search Community

Horizontal scroll inside modal with less than 100vh height

Charlie Stevenson test
Moderator Tag

Recommended Posts

Hi all,

 

How would I go about achieving horizontal scroll with progress bar in a setup similar to my CodePen example? I can't figure out what I'm doing wrong.

Trying to scroll the white blocks inside the modal.

(using querySelectorAll as content is dynamic)

 

Thanks in advance,

Charlie

 

See the Pen eYKNmGy by CharlieStevenson198 (@CharlieStevenson198) on CodePen

Link to comment
Share on other sites

Hi,

 

The issue I see here is about scrolling space. In order to make ScrollTrigger work you need some scrolling available, with a modal that implies making the modal scrollable on the X axis. I think using the Observer Plugin is a far better alternative in this case:

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

 

Also I created a simple example using Draggable as well, in case you want to explore that alternative:

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

 

Let us know if you have more questions.

 

Happy Tweening!

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