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

What is Framer? Join the Community
Return to index
Utkarsh Mishra
Posted Oct 27 - Read on Facebook

Hi guys,

Can someone help me in guiding how to make an accordion type of collapsible menu?

On clicking the folder item, I want it to expand and show child list items. On clicking again, I want the whole thing to collapse. I tried it, but couldn't add two events on a same element.

Any help would be deeply appreciated.


Mark Frederik Meyer

You could use a boolean variable, something like:
var opened = false;
button.onClick ->
if (opened==false) {doTheOpening and set opened to true}
else {doTheClosing and set opened to false}

hope that helps!

Ehren Miller

Alternately, you might want to consider doing this through adding states to the parent menu instead of writing two separate animations.

Jordan Robert Dobson

Yes. Look into states.

Read the entire post on Facebook