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

What is Framer? Join the Community
Return to index
Ee Venn Soh
Posted Sep 14 - Read on Facebook

I have 2 images and I want to alternate the visibility between the two of them. By showing image A then hide it, show image B then hide it, then show image A again and so on... What will be the best way to do it?

6 Comments

Anton Jarl

So, 4 clicks to go through it like: Show A, Show nothing, Show B, Show nothing. Or is it just two clicks: Show A, Show B?

Balraj Chana

Hey Ee, if the images are on top of each other you're alternating the visibility on click, then here's one way of doing it: http://share.framerjs.com/qttcy8j4xcmf/

Claudio Guglieri Lillo

States?

Ee Venn Soh

It is not a user triggered action, it is like a GIF, animating / pulsating indefinitely. I created 2 animations for image A and image B. When AnimationEnd for imageA, .start() animation for image B... It works, I am just looking if there are any other ways of doing it.

Fredrik Ampler

you might be looking for:
# Alternate between the two animations
animationA.on(Events.AnimationEnd, animationB.start)
animationB.on(Events.AnimationEnd, animationA.start)
http://framerjs.com/docs/#animation.reverse

Anton Jarl

You could use utils.delay to switch between them as well, and depending on what your GIFs looks like you might want to create those animation directly in Framer to a quicker turnaround time when retiming things

Read the entire post on Facebook