Jump to content
Search Community

timeline to only run once, but not when navigating back to homepage

mattdavis06 test
Moderator Tag

Go to solution Solved by OSUblake,

Recommended Posts

Hi,

 

I've recently started using gsap (impressed so far!). However, I have a timeline which I only want the animations to run when the homepage first loads.

 

I've set a key and value in sessionStorage.setItem()checked if the page has been visited in getItem()and then called  tl.paused(true) on the timeline if true. But this obviously pauses everything. I basically want the animations to run on each first visit to the site, but not when navigating through different pages on the site, then when revisiting the hompage all the elements are in place without the animations.

 

Is this possible or a simple way to do this?

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...