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. 

Share this post


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

Share this post


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

Share this post


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. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×