Search code examples
coffeescriptframerjs

How can i call the coffee script function on body load


I am using the app.coffee coffee script file to create some animations on the framerjs prototyping tool. what i want to achieve is that i have defined a function and i want to call that function on body load. how can i do that in coffeescript?

Code:

changeNumbers = -> 
    sketch.More_Details_Text.visible = false
    sketch.Less_Details_Text.visible = true
    expandanimation1.start()

Solution

  • You just call the function in your app.coffee

    changeNumbers()
    

    This is executed whenever you open or reload your prototype.

    This answer might be too simple but maybe you can explain your problem more if that doesn't help. Are you working in Framer Studio?