Jump to content
Search Community

Can I use scrollTrigger on a scrollable modal window?

mchimaaa test
Moderator Tag

Go to solution Solved by mikel,

Recommended Posts

Dear guys,

I'm loving your work, GSAP, and I would like to use scroll animation on a modal window like this Pen.

 

 

My target is in a modal window and my modal window is scrollable.

(In this pen, I don't know why but this modal can't scroll, it must be scrollable...)

 

Can I use scrollTrigger on a scrollable modal window?

 

Thank you for reading.

See the Pen yLaXZRw by pepechima (@pepechima) on CodePen

Link to comment
Share on other sites

  • Solution

Hey @mchimaaa,

 

Welcome to the GreenSock Forum.

 

See the DOCs of GSAP ScrollTrigger

 

scroller String | Element - By default, the scroller is the viewport itself, but if you'd like to add a ScrollTrigger to a scrollable <div>, for example, just define that as the scroller. You can use selector text like "#elementID" or the element itself.

 

And: a scrollable <div> needs some content which is 'heigher' so it makes sense.

 

Happy scrolling ...

Mikel

 

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