Question I am running a for-loop which I animate several layers y positions. I'm trying to have a function fire off once the last layer animation ends. Is this possible with coffeescript?
here the code I done so far
screenTrans = -> for layer, index in arr layer.animate delay: .1 * index properties: opacity: index * 0 y: layer.y + 50 curve: Spring(damping: .6)
if index >= arr.length - 1 ?
Try 'arr[arr.length].onAnimationEnd -> etc' . Put it in the function but after your loop and it should work.
I think this is because everything is an expression you can actually add the animationEnd event outside the loop and it'll apply to the last item created in the loop.Here is an example: https://framer.cloud/fJKzU
Thanks guys. Will give it a try.