mchimaaa Posted December 19, 2020 Share Posted December 19, 2020 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 More sharing options...
Solution mikel Posted December 19, 2020 Solution Share Posted December 19, 2020 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 4 Link to comment Share on other sites More sharing options...
mchimaaa Posted December 21, 2020 Author Share Posted December 21, 2020 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! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now