Jump to content
Search Community

GSAP animation laggy after initial load

vierless_julian test
Moderator Tag

Recommended Posts

Hi fellow GSAP friends,

 

a few months ago I was asking for a scrub animation that we were developing for our new page. This page is now live and we are receiving some weird laggy bug after loading the page. The animation appears super laggy for a few seconds and then slowly gets better until it runs smoothly after some time.

 

The live page is: https://vierless.de/

The prototype I built a few months ago that is running on our live site now can be seen in codepen: 

 

I hope someone has an idea why this is happening and how we can stop this.

See the Pen wvEjpgL by julian_witzel (@julian_witzel) on CodePen

Link to comment
Share on other sites

I can't see any laggy behaviour, not on the codepen or on the live site. I do see that you are animating your trigger element, which you should never do. ScrollTrigger uses the start and end based on the trigger element, but you keep moving the trigger element in your tween.

 

You could also check if some third party script is adding transition values to the items you're animating with GSAP. If I open your CSS on the live site and search for transition: all I see a view lines pop up, in my personal opinion you should never transition: all, and only every specify the particular properties you want to transition. And you should never use css transitions on the properties you want to animate with GSAP, then JS and CSS will fight for who gets to animate when, which will cause 'lag'.

 

But again I see none of this in your demos on macOS on either Safari or Chrome. 

  • Like 3
Link to comment
Share on other sites

@mvaneijgen This is my first time of implementing a GSAP animation. So I appreciate any tips on how to improve my current code. Talking about the transition: all, we are using WordPress and a page builder for the page and the most of the CSS is generated through it. Unfortunately it adds a lot of all values. But also here: If you have tips on how to improve/change this I am open to hear them!

Link to comment
Share on other sites

Just now, vierless_julian said:

we are using WordPress and a page builder for the page and the most of the CSS is generated through it. Unfortunately it adds a lot of all values.

And these tools can cause issues. I've reproduced your steps (except clearing cache, maybe try disabling this plugin for a while and see if some setting is causing this issue), but I'm still not seeing it.

 

At line 34 in your codepen       trigger: '.video-container', should not be the same element as at line 9   gsap.fromTo('.video-container', preferably the trigger element should be a higher top level element something like .video-container-trigger. You could also disable the filter blur tween to see if that makes any effect. We can debug live website, it would be best if you could create a codepen with the issue then we can dive in and help you debug, for if it only happens on your live site you'll be the only one that can debug, just start by disabling big chunks of code to help isolate the issue. 

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