Andy777 Posted February 15, 2023 Share Posted February 15, 2023 How i make this scale to 0.7 on scrolling? I mean the first section to scale See the Pen dyqPbMB by Andy199807 (@Andy199807) on CodePen Link to comment Share on other sites More sharing options...
Solution mvaneijgen Posted February 15, 2023 Solution Share Posted February 15, 2023 ScrollTrigger uses the native scroll to do all its logic, you are overwriting that native scroll by setting the body to overflow hidden. If you don't know 100% what you are doing and why you're doing it I recommend not overwriting the default scroll behaviour and just let the browser handle scrolling! This will save you a lot of debugging later. I would also recommend getting in the habit of animating a different element than your ScrollTrigger. ScrollTrigger uses the location of the trigger element to calculate everything, if you then move that element with an animation ScrollTrigger loses track of that element (so to say). Hope it helps and happy tweening! See the Pen YzOPzyN by mvaneijgen (@mvaneijgen) on CodePen That said, you can set the scroller to a different element then the default viewport, but again only do this if you're confident in your skills and 100% know what you're doing, see the docs https://greensock.com/docs/v3/Plugins/ScrollTrigger 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. 2 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