Skip to content

Instantly share code, notes, and snippets.

@nvh
Forked from joshuacrowley/buttonToggle.coffee
Created July 18, 2016 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nvh/94b288aec6978c80b14e5a4eae081e19 to your computer and use it in GitHub Desktop.
Save nvh/94b288aec6978c80b14e5a4eae081e19 to your computer and use it in GitHub Desktop.
Simple toggle button setup for Framer.js
for button in sketch.headerBttn.children
button.states.add
off:
opacity: 0.5
on:
opacity: 1
button.onTap (event, layer) ->
others = _.without(sketch.headerBttn.children, layer)
for other in others
other.states.switch("off")
layer.states.switch("on")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment