Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Vincentccw

Staggering webpage on page load?

Recommended Posts

I want to create an effect that it will load my web page gradually from 1 div to another once the page load.

I have applied staggerFrom() method so that it can create the desired effect that will load from the header follow by content and extend till footer.

 

But my problem is that when I put it on live server, the webpage will load the animation even though the content isn't fully loaded, resulting in freezing the animation for few seconds....

 

Is there any solution for this?

Link to post
Share on other sites

Are you saying that the animation starts playing and then freezes in the middle? Or are you seeing all the content appear before the animation starts playing?

 

Hard to offer a solution without seeing some code. A very basic codepen or jsfiddle demo would really help.

 

Although I'm not really sure what's happening, I'd suggest that you use some javascript to detect that your page is fully loaded (html and images) before starting your animation.

window.onload=pageLoaded;

function pageLoaded() {
   //code to start you animation
}

https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.onload

 

if you are using jQuery, you can also use $(window).load()

http://api.jquery.com/load-event/

  • Like 2
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.

×