Site logo

Archived topic

Load animation only once per website visit

5 replies · Started by Dominik on November 12, 2020

Viewing posts 1–6 of 6

Hi there,

we have made a small intro animation with javascript and css and need to show the animation only once per website visit. We couldn´t find out how this could be made.

https://ccl.brandwerk-digital.com/

Thanks for your help!
Dominik

Hi there,

aside of using Cookies to detect a users first visit you can use localStorage to store a variable for the visited status and then use that as a condition to run your code. Heres an example of that.

https://stackoverflow.com/a/31867239

Hi David,

thanks for the input. I couldn´t get it run and tried the function with an alert. that works well – but only one time. Is it possible to create a function that runs the code once per website visit..if you click the start page a second, third,...time, no code will run. But if you close the window and open a new one...the code will run once again?

Thanks!

Perfect – Thank you very much!!!

You're welcome

This archived topic is closed to new replies.