Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
carlos.rosales

Page loading animation just once.

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 post
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 post
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 post
Share on other sites

Thanks a lot, I am trying to use the code nippet on that link with no luck yet.. pretty new to js so things get easily complicated. 

Link to post
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.

×