How to stop and repeat a custom event?

Hi everyone,

I’m playing with a full-screen animation of sorts to scroll through large hero images.

Putting aside my wish for 100vh for now, I’m nearly happy with the results but I’m stuck on getting this the rest of the way…

  1. Loop this: Is there a way to loop this? I tried playing with a counter on a custom state (last action in the screenshot) and then created a workflow for when “counter” is say 1, run the custom workflow. It almost works! But for some reason, it’s skipping the first 3 (out of 5) groups.
    I’ve seen that loops aren’t supported by Bubble in this way so I’m not sure if I’ve just got a “is visible” issue or a looping issue. Thoughts?
  2. Stop this: I’d like to add buttons to the bottom of the page so a user could jump back to a prior group (slide) and stop the workflow. Show Group A seems like it works but then the workflow takes over and keeps right on going.
    (Ironically, when you click “show group A” it makes the looping work as you’d expect!)

Thanks everyone!
Jen

  1. The time that it takes for the workflow to run could be longer than the loop itself. Why don’t you use the “do every x seconds”? It’s perfect for animations.

  2. Use custom states for this. When a user clicks on the button, set a state of an input to x. Have the workflow that’s doing the animations to only run when the value of the input is not x.

@hi1 - not sure if you’ve tried this already but what if you had a General event for Every 5 Seconds (or whatever duration you need) that would increment a Custom State value (1 to 5?) and assign a value to each of your Animation Groups to be visible. The value would get incremented (you’d need to reset back to 1 at the end of your loop).
You could use another Custom State which would detect the button(s). This Custom State would be used as a “Only when” criteria for the “Every 5 Seconds” event to stop your animations.

Hope that made some sense.

Thanks!
I think I got it looping by doing every 15 seconds.

But custom states to stop the animation don’t really work. What happens when the button was pressed is that the group would show up but then the animation would continue however many more “slides” were left. The custom state did make it so the animation wouldn’t loop but it wasn’t a good look.

For now, I’ve removed the buttons but I’m still curious how we might be able to stop a workflow.

One idea was to add “only when” to each action within the workflow it feels like there should be a better way.

Thanks!

@hi1 could you please provide a link with your specific example?

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