Forum Documentation Showcase Pricing Learn more

Header Help with Animation


#1

Anyone know how I would go about making this header https://www.groupon.com/merchant?utm_medium=referral&utm_campaign=groupon-footer&utm_source=groupon

When you scroll it does this cool animation that turns it white. Any ideas?

I don’t just want to show it with a conditional but want it to animate. Thanks in advance.


#2

Hi,

I think you can create a workflow with When a condition is true, and using the condition page scrolling position is more than XXX (200 for example). Then use the subsequent actions to animate the elements you want.

Hope it helps!


#3

Ya I tried that, but it only works if I put it as “once”, not “every time” it scrolls. If I do every time I think it tries to do it every time a scroll which doesn’t work.


#4

I think it is working on IE but not on Safari. Edit: Actually with further testing it is not working on IE either.

Editor: https://bubble.is/page?name=index&id=smogtest2&tab=tabs-1
Preview: https://smogtest2.bubbleapps.io/version-test?


#5

maybe playing with states in your actions, at the end of the animations, set state of header to “animationcomplete” to yes

So your workflow might be if scrolling position > 200 and header’s animation completed is “no”

Then you can do the same on the other side, when scrolling position < 200 and animation completed is yes then do the “reverse” animation


#6

I tried that too, I couldn’t get it to work. I guess I can try that again.


#7

your animation works perfectly for me on chrome…


#8

Keep scrolling up and down a few times. Does it “break” on you too?


#9

yeah after some times indeed. Maybe trying to set the scrolling position not at zero but a bit more . (e.g. 10). As I don’t know with the “elastic” behaviour how the position is actually calculated.


#10

Seems like still after a few times it will “break” I changed it to 10


#11

It might come then for reactivity of the workflows. As you go fast scrolling up and down, two workflows enter in conflict


#12

Ya, you think that is a bug? Or…


#13

Not really a bug, but I guess you get into a sort of limitation. The animation has not yet the time to complete than the other animation is already triggered…


#14

It’s weird because the conditionals work just fine, to show and hide it without an animation.


#15

Because it’s instant, whereas the 'sliding effect ’ have a duration
What if you reduce the animation duration?


#16

Ya, if I set it to 0 it works. Hmm, I guess you are right, I might not be able to do that the way I want. Unless you have another work around to get it to work.


#17

I don’t really see a workaround here, except lowering a bit the animation duration.

But, in a UX point of view, it’s always good to step back and keep in mind that the big majority of users won’t try to scroll quickly up and down to break the header behaviour ! :wink:

So it seems good enough now to try it as it…


#18

Ok, thanks, I set the duration to 200 and it seem like a sort of happy medium. When it breaks it shows up half at least