Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

275
Views
¿Cómo hacer que el desplazamiento automático llegue a la parte superior del div?

esta es mi captura de pantalla:

ingrese la descripción de la imagen aquí

Mi pregunta es cómo hacer que se desplace automáticamente hacia arriba en javascript o de alguna otra manera.

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

element.scrollTop = 0; le permitirá llegar a la parte superior de desplazamiento del elemento:

 var el = document.querySelector('div'); el.scrollTop = el.scrollHeight; setTimeout(function(){ el.scrollTop = 0; }, 500);
 div{width:200px; height:200px; overflow:auto;}
 <div> <br>Top-<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>- </div>

over 4 years ago · Santiago Trujillo Report

0

Por favor, intente esto:

 window.scrollTo(0,0);
over 4 years ago · Santiago Trujillo Report

0

Dale una identificación a tu div. Y entonces:

 var myDiv = document.getElementById('yourdivid'); myDiv.scrollTop = 0;
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!