jackkemm Posted July 3, 2021 Share Posted July 3, 2021 Hi I'm hoping someone can help. I have got this range slider working with the help of Blake on a previous post, but have one more thing to do before it's complete. The range slider is using inerpolate and clamp and I am setting the initial values using the progress value with interpolate. I am allowing the user to add in a value to a number input on the left, and am wanting the slider knob to adjust accordingly. Is there a way to translate that in to a progress value or pass the value directly? Thanks in advance. Jack See the Pen YzVyVbb by jackkemm (@jackkemm) on CodePen Link to comment Share on other sites More sharing options...
Solution GreenSock Posted July 3, 2021 Solution Share Posted July 3, 2021 I assume you're looking for https://greensock.com/docs/v3/GSAP/UtilityMethods/mapRange() Or even simpler, if you're wanting to map it to a range of 0-1, you can use https://greensock.com/docs/v3/GSAP/UtilityMethods/normalize() 1 Link to comment Share on other sites More sharing options...
jackkemm Posted July 3, 2021 Author Share Posted July 3, 2021 Hi Jack, Thanks for the guidance. Works like a charm! I have one more question I am hoping I can ask here too. I need to change direction for mobile to be on the x axis. Is it just a matter of killing the Draggable instance and re initialising it in the new direction? Thanks, Jack Link to comment Share on other sites More sharing options...
GreenSock Posted July 3, 2021 Share Posted July 3, 2021 6 minutes ago, jackkemm said: I need to change direction for mobile to be on the x axis. Is it just a matter of killing the Draggable instance and re initialising it in the new direction? Sounds correct to me. 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