Jump to content
Search Community

Flash of content when using ScrollTrigger

marius96 test
Moderator Tag

Recommended Posts

@ZachSaucier

Thank you for tightening up my code!

 

Yes, the same flash occurs in the CodePen.

I don't have anything else on my page.

I thought my problem was caused because I was using big *.png files, but I coverted all my images to the *.webp format, but I didn't see any changes.

Link to comment
Share on other sites

@ZachSaucier

Yes, I tried it on my iPhone, and everything is working as it's supposed to.

Edit:

I tried it on the desktop version of Chrome, and it seems to be fine.

Looks like Microsoft Edge based on Chromium is the culprit.

The performance on Firefox is pretty bad, do you have any tips on how can I improve that? Or do I need to manually mess up with the scrolling behavior in the config of the browser? 

Link to comment
Share on other sites

I did a few little experiments, so I could narrow the problem.

Testing this on my laptop ( it has a pretty weak config ) and a 1080p screen, everything is going smoothly, even Firefox's performance ( that flash is still present in Edge ).

I added will-change: transform and rotation:0.01 , but it didn't improve the performance in Firefox. ( very choppy scrolling and animations on my main computer, which has an i5 - 6600k ).

So, I decided to open the task manager and the results are suprising:

  • scrolling in Edge or Chrome on my main computer gets the CPU usage up to 2-3%;
  • scrolling in Firefox on my main computer gets the CPU usage up to 15%.
  • CPU usage on my laptop always higher on Chrome, making the results are inconclusive.

 

Link to comment
Share on other sites

I don't see the flashing however:

 

I looked at the image assets you were using all the images appear to be the same size at 2540 * 1319 yet the  active image area for each  generally takes up only a small part of the image frame with a huge area of transparency. With 11 images layered over top of one another the browser is calculating an enormous number of transparent pixels unnecessarily for render.

 

While I get how this makes it easier to create and lay-out the assets if the images were cropped to surround only the active image area the browser would likely have a greatly reduced workload rendering this.  More work getting everything positioned just so but it might pay off performance wise.

 

 

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