Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

144
Vistas
How to make a smooth scroll animation onclick on IOS devices?

I am building a footer and of the options of the footer is "home" and when it's clicked it should scroll smoothly up and that works on my pc, but what I noticed is that it doesn't work on IOS devices. I read that the css line: HTML{ scroll-behavior: smooth;} does not work on IOS devices
<!--html code<a class="link-1" onclick="test()" href="#">Home</a>
I read a lot of the forms here on Stack Overflow. I tried a lot of thing such as:

  window.scrollTo({ top: 900, behavior: 'smooth' })
}

or using css

    overflow:scroll
-webkit-overflow-scrolling: touch;

or

document.querySelectorAll('a[href^="#"]').forEach(anchor => {
    anchor.addEventListener('click', function (e) {
        e.preventDefault();

        document.querySelector(this.getAttribute('href')).scrollIntoView({
            behavior: 'smooth'
        });
    });
});

But nothing worked. It just jumps to the top. I'm slowly running out of ideas.
Any ideas? Thanks!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda