Streaming live at 10am (PST)

Conditional load animation - load only once


#1

Hi there,

I have created a animation for my header that is executed on load. I am looking for a way to make this animation conditional, so that it is only executed on the first page of the website that is visited. At the moment it is displayed each time that the user loads a different page of the website and to my taste that is a bit much

I have thought about creating a different header for the home page, the only one to have the animation, but then the animation will not appear when a user enters the website via a different page. Also this would show the animation again when the user navigates back to the home page. So if possible, I would like to make the animation conditional, depending on whether it is the first page viewed within the website.

I would love to hear if any of you have some suggestions of how to accomplish this. I have briefly been in touch with the Webflow support, who suggested putting custom code in the header and checking out this forum for a way to do that. I have looked around, but haven't found what I am looking for. Neither am I an expert in coding, hence I hope to find some useful suggestions this way.

Read-only link: https://preview.webflow.com/preview/liberia-health-beat?preview=3ed02a216df00849d64f1cc86bbc9cf0
Published site: http://liberia-health-beat.webflow.io/


#2

Hi,

That's a typical 'show only once' behavior, that's usually works with Javascript and setting a cookie on the users' end.

Quick search: (it's often used for modals) https://www.google.fr/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=cookie%20show%20once

I'm sure most of the examples will be for a 'once and for all" behavior, but you can make one for 'once every visit' I guess.

Sorry I'm not very used to that so my answer is pretty vague but I thing this is the technology you're looking for.


#3

#4

Hi @vincent,

Thanks for your reply, and I do think I understand what you are trying to say :slight_smile:
As you already pointed out, your solution will lead to the animation only showing once, not per visit, but until the browser cookies are erased. This is not exactly the behavior I am looking for. I would like the animation to show each time a user opens the website for the first time (irrespective of which page is visited first).

I will keep looking!


#5