Jump to content
Search Community

Page loading animation just once.

carlos.rosales test
Moderator Tag

Recommended Posts

Hello, I have a set of animations going on when my home index page loads. 
Is there a way to prevent animation triggering again when a user was on another page an goes back to the home page where the on page loading animation is set?

 

Many thanks in advanced anyone who would like to throw me a hint. 

Link to comment
Share on other sites

Your question doesn't really relate to Greensock, specifically. It's more of a JavaScript / HTML question. From the link below, it looks like you can add / remove classes on page load using JavaScript. The behaviour will be reset if the end user clears their browser cache.

 

https://teamtreehouse.com/community/use-javascript-to-animate-only-once

  • Like 1
Link to comment
Share on other sites

23 minutes ago, carlos.rosales said:

Is there a way to prevent animation triggering again when a user was on another page an goes back to the home page where the on page loading animation is set?

 

Welcome to the forum @carlos.rosales.

 

You can use Local Storage or Session Storage, see the below thread discussion.

https://greensock.com/forums/topic/17928-stop-animation-from-playing-when-page-is-already-visited

 

  • Like 4
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...