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

176
Vistas
How to get to the top of page without scrolling

This problem has troubled me for a long time: I want the page to reach the top without scrolling.

I tried this, but it didn’t work:

window.scrollTo({
  top:0,
  behavior: 'auto'
 });
about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

you need both x-coord and y-coord

Try this

window.scrollTo({
  top: 0,
  left: 0,
  behavior: 'smooth'
});
about 4 years ago · Juan Pablo Isaza Denunciar

0

if your aim is to avoid the actual scrolling (the "animation"), use behavior: 'instant'.

const button = document.getElementById('instant-top-button')
button.addEventListener('click', () => window.scrollTo({
  top: 0,
  behavior: 'instant',
}))
<p>scroll down &#11123;</p>
<p>
  <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
</p>
<button id="instant-top-button">&#11121; to top, instantly!</button>

about 4 years ago · Juan Pablo Isaza Denunciar

0

please, try a simple solution. Just replace your code for this here:

window.scroll(0, 0);

Cheers, Marcelo

about 4 years ago · Juan Pablo Isaza Denunciar
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