Framer Classic » Range slider » Setting the values of the slider

Setting the values of the slider

Simply setting a different minValue or maxValue will move the knob instantly, while passing a value to animateToMinValue() or animateToMaxValue() will smoothly animate the knob to the new position.

# setting new values
slider1.minValue = .2
slider1.maxValue = .8
# animating to new values
slider2.animateToMinValue .2
slider2.animateToMaxValue .8

As an optional second argument you can add animation options.

# using a custom animation
slider3.animateToMinValue .2, curve: "spring(1000,10)"
slider3.animateToMaxValue .8, curve: "spring(1000,10)"
Setting the values / Animating to new values / Using a custom animation
Open in Framer

Leave a Reply