wpsoul Posted August 28, 2022 Share Posted August 28, 2022 I have a pleasure to test new Observer. It solves many needs and I want to build simple gallery with it. And relative gsap parameters are very helpful for such task. So, each swipe right, I add some relative value x:+=5. But now, I need to set limit of what is scrolled. So, I need to get current value before animation and check if it's not bigger then some value. Is using https://greensock.com/docs/v3/GSAP/gsap.getProperty() is correct way to do such tasks or there is some Observer utility? Link to comment Share on other sites More sharing options...
Solution GreenSock Posted August 28, 2022 Solution Share Posted August 28, 2022 Yep, if you want to get the current value, gsap.getProperty() is perfect for that. And if you're trying to clamp things, you might want to look into the utilities like gsap.utils.clamp(). Good luck! 👍 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