Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
mchimaaa

Can I use scrollTrigger on a scrollable modal window?

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 post
Share on other sites

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 post
Share on other sites

Hello @mikel

 

I hadn't notice that option.

Thank you for your kindness!

The GreenSock Forum is so kind for the beginner, love it.

 

Thanks!

  • Like 1
Link to post
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.

×