Jump to content
Search Community

How to add delay first page load only?

Ivan Mocs test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

  • Solution

Maybe just check to see if it's within a certain amount of time since load?  

let isStartup = true;
window.addEventListener("load", () => {
  setTimeout(() => isStartup = false, 3000); // after 3 seconds, set isStartup to false
});
ScrollTrigger.batch(".fadeup-startup", {
  onEnter: elements => {
    gsap.from(elements, {
      autoAlpha: 0,
      y: 60,
      stagger: 0.2,
      delay: isStartup ? 2.3 : 0
    });
  },
  once: true
});

 

 

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