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

147
Vistas
How to ? (1) after scrolling a webpage to the top (2) then automatically reload a page

What's the html javascript code for after scrolling a webpage to the top then automatically reload a page (not the other way around). Thank you!

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

document.onscroll = () => {
    if(scrollY === 0){
    location.reload()
}}
about 4 years ago · Juan Pablo Isaza Denunciar

0

The easiest solution will be to use js to click a link. Say that on the top of the page you have a div with id of top:

<div id="top">top section of page</div>

Then all you need to do in js is just to click on a virtual anchor element:

let a = document.createElement("a")
a.href = "#top"
a.click()

Then just call window.location.reload() to reload the page

I haven't tested this but the main idea works

about 4 years ago · Juan Pablo Isaza Denunciar

0

function topScrollAndRefresh() {
  document.body.scrollTop = 0;
  document.documentElement.scrollTop = 0;
  setTimeout(() => {
      window.location.reload()
  })
}
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