Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

154
Visualizações
Images flashing on iPhone when modifying container scrollLeft/scrollTop values

I've been developing a complicated infinite 2D layout with animations in JS+CSS. I could manage to make everything work except that in iPhone the images flash when scrolling around the layout (I haven't tried in other iOS yet).

I believe the problem has to do with altering the scroll of the container inside a scroll event listener like this:

let main = document.getElementById('container');

main.addEventListener("scroll", event => {

    let viewportWidth = document.documentElement.clientWidth + 1;
    let viewportHeight = document.documentElement.clientHeight + 1;
    main.scrollLeft = checkLimits(main.scrollLeft, 0, 3500 - viewportWidth);
    main.scrollTop = checkLimits(main.scrollTop, 0, 2800 - viewportHeight);
    
});

I have isolated the problem, check out the complete code here.

I have done many tests: isolating main.scrollTop and main.scrollLeft, placing them in a setInterval/requestAnimationFrame instead of and event listener, even desperate tests like using "touchend" event instead of "scroll")... but I couldn't get rid of the flashing, that I would say it starts as soon as the first statement main.scrollLeft = or main.scrollTop = is executed.

Is this an unavoidable bug? Please help!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda