How to loop an animation?

Hello,

I’m doing an animation on hover with condition is true workflow:

Your Bubble app (3)

However as you can see, the animation stops after a second or so. I would like this animation to go on and on as long as the object is hovered.

How can I achieve that?

Hey :wave:

Here is an example of what you can do. There are multiple ways but here is just the first way I thought of.

Preview: https://805testapp42.bubbleapps.io/version-test/hover?debug_mode=true

Editor: 805testapp42 | Bubble Editor

Want to learn more?

www.nocodeminute.com

Presenting

Hope that helps! :blush:

3 Likes

That is an elegant, simple solution. Actually just encountered this in another project - This way is much better. Great post! Thank you.

1 Like

Glad it helped! :raised_hands:

Thanks. I was thinking about using an “every second” workflow, but I was concerned about doing this for all the icons on the interface and whether it would not cause the client to be overloaded and consume resources needlessly.

Yeah. I’m not sure. You would have to test it out. Try one workflow but it checks multiple things if possible. Or send the same one thing to the set state and it only animates the group that is sent. So it could still potentially be one workflow for different things. Maybe give a number to each element? Does that make sense?

1 Like

It makes sense. Maybe it’s worth a separate question to see what the Bubble team would suggest with regard to using the every 1 sec flow.

1 Like

I’ve been using a do every 5 sec to run a small animation. I haven’t seen any slow down or overloading issues with it.

I think @romanmg was using a do every x second to save current date time in a custom state. I remember trying it out when I watched the video and I didn’t see any crazy behaviour from it. But it would be really interesting to hear from the bubble team on this.

Not to hi-jack the thread, but it would be really interesting to see more blog posts/videos on best practices. The vast majority of us aren’t developers and we also don’t know what magic goes on under the hood. I remember seeing @Emmanuel (I think) replying in some thread about the usage of too many states or something and found that really interesting.

Like the old adage goes “with great power comes great responsibility” and that is certainly true with such an open and complex system as Bubble. But without having any information on what those responsibilities actually are, I suspect a lot of frustration and bug tickets are due to a lack of knowledge of best practices. :slight_smile:

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.