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

What is Framer? Join the Community
Return to index
Niels Flindt Koelmeyer
Posted Jan 08 - Read on Facebook

Does anyone know what I'm doing wrong here? Trying to make a sidebar with some list items that each has three states - default, hover, clicked - basic tab stuff: Only one item can have a clicked state at a time.
Yet somehow, I'm running into errors: 1) I can have multiple items in clicked state and 2) onMouseOut, a clicked item will have both a Default state and a Clicked state.

Does anybody have an answer?



Paweł Ludwiczak

Hey, this should help:

I bet you will get the differences. But here's brief desc:
1. You have to add transparent background to other (than clicked) states because it has to overwrite the yellow background
2. when you click on an item, you have to iterate through all items again in order to make an action on them (apply default state).
3. i let myself simplify few things

Niels Flindt Koelmeyer

This is awesome, Paweł Ludwiczak. Thanks for helping me out here. I understand everything you've done, except for the '(1)' in @siblings.forEach (1) -> 1.stateSwitch('itemDefault'). Care to explain what's going on here? Thanks!

Read the entire post on Facebook