This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Thomas Offinga
Posted May 10 - Read on Facebook

Is there a way to overwrite the default animation speed using a Slidercomponent? Whenever I do this, it doesn't seem to get overwritten.

animationspeed = 0.4

Framer.Defaults.Animation =
> time: animationspeed

animationSpeedSlider.on "change:value", ->
> animationspeed = Utils.round(animationSpeedSlider.value, 1)

2 Comments

Trevor Phillippi

you're assigning the value of animationSpeed at the time you're referencing it. JS has no concept of pointers, so Framer.Defaults.Animation wont be updated when you update the value in the slider's change handler. You want to assign the new value to the animation defaults in the handler to ensure it's kept up to date.

Trevor Phillippi
Read the entire post on Facebook