locomotivemtl / locomotive-scroll

πŸ›€ Detection of elements in viewport & smooth scrolling with parallax.
https://locomotivemtl.github.io/locomotive-scroll
MIT License
7.56k stars 1.11k forks source link

Flickering on scroll #452

Open nicolasgermeaux opened 1 year ago

nicolasgermeaux commented 1 year ago

Hello πŸ‘‹

Describe the bug I have a sort of flickering when I scroll on my websites using the loco scroll. I saw on the example website that there is also this problem but not as much as I have on my side.

Note : I don't notice this problem on Firefox.

Desktop (please complete the following information):

Thank you πŸ‘Š

jusstes commented 1 year ago

Faced a similar problem, but with one feature. Freezes like this only happen in power saving mode on my mac pro M1. When working without this mode, everything works smoothly. Problem determining this state as navigator.getBattery() is not supported in Safari

RohanClaclaws commented 9 months ago
 <div id="main" data-scroll>
        <div id="page1">
         //Content
        </div>

        <div id="page2">
         //Content
        </div>
</div>

JS CODE

const scroll = new LocomotiveScroll({ el: document.querySelector('#main'), smooth: true });

Its is flickering for the following css :

main{

overflow: hidden;
background:#1D1D1B;

}

page1{

height: 100%;
width: 100vw;

overflow: hidden; background-color: #C8C0B6;
}

page2{

width: 100%;
height: 100vh;
background-color: #C8C0B6;
margin-top: -2px;                    // Solution for Flickering Problem just add this

}

Just overflow lap the next frame with margin-top to -2, It will solve your problem

j4kim commented 3 months ago

I don't know if it's the same problem but I'm facing massive flickering on my site. Here is a screen capture: Enregistrement de l’écran 2024-04-01 aΜ€ 16.24.04.webm

I've tried this solution and it seems to work but it's hacky and on an outdated version.

Update: migrated to v5 and no more flickering