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

What is Framer? Join the Community
Return to index
Kat Reilly
Posted Jan 15 - Read on Facebook

Hey folks,

Stuck on an issue and am summoning the troops for some help!

I'm trying to animate all of the items in a for-loop, but my method is only causing the last item in the loop to animate. I'd appreciate any insights on how to fix.

Example here:

4 Comments

Florian Pnn

The "object.animate" isn't indented as it should, therefore it's excluded from the for loop :)

Kat Reilly

Thanks, Florian! Worked perfectly!

Now riddle me this:
What's the best way to structure the code if I wanted to tie the animation to an event (for example, pressing a button outside of the for-loop container?

Example here:
http://share.framerjs.com/odqjvoweaae5/

Florian Pnn

I usually use do()-> which is doing an anonymous function to avoid the scope problem. To read about it : http://rzrsharp.net/2011/06/27/what-does-coffeescripts-do-do.html

Your example with it : http://share.framerjs.com/wnylhdb211t6/

Kat Reilly

This is a great help! I doubt I would have stumbled upon the magic do()-> function myself.

Thank you again, Florian!

Read the entire post on Facebook