Share Posted December 9, 2020 Hi everyone, I want to use ScrollTrigger to trigger some elements when the red box reach to the top of screen (or the top of the wrapper ). But the marker(start) doesn't move if you scroll in the wrapper. Is there a way to trigger animation in the wrapper? The box is just for the demo and I want it back to the original shape when the red box pass the end point. Thank you. See the Pen OJRREOJ by shunyadezain (@shunyadezain) on CodePen Link to comment Share on other sites More sharing options...
Share Posted December 9, 2020 If you need to apply a ScrollTrigger based on an element other than the body you just need to specify the scroller in the ScrollTrigger: scroller: ".wrapper", If you want it to be relative to the viewport and you have it within another element with a scroller you'll have to manually offset the start position by calculating how much if should be offset by and adding that in. 1 1 Link to comment Share on other sites More sharing options...
Author Share Posted December 9, 2020 @zachSaucier Thank you for your quick response! It works and I'm glad to ask you a question here! 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