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

263
Vistas
Scroll to a div after a few seconds

I am trying to smooth scroll to a div after about a minute on a page. I looked on here and found this answer but it did not help me as the person who gave the answer didn't really answer the person's question.

I'd prefer to use jQuery but I am open to JavaScript as well.

Here is what I have so far:

$(document).ready(function() {
        $('body').delay(5000) 
        .animate({
      'scrollTop': $('#usp').offset().top
        }, 5000); 
    });
about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

I hope this helps:

( function($){

setTimeout( function() {
$('html, body').animate({
        scrollTop: $("#elementID").offset().top
        // you can use $(".elementClass") but as ID should be unique, it would be better to use an element ID instead of classes
    }, 2000);
    // 2000 ms is the animation duration

}, 5000) 
// it scrolls to #elementID after 5000 ms = 5 secs

} )(jQuery);

about 4 years ago · Juan Pablo Isaza Denunciar

0

You can use Something like this which is quite easy. Just Create a function with some name and call it after few seconds.

$(document).ready(function() {
    function scrolltodiv(){
            $('html, body').animate({
                scrollTop: $("#myDiv").offset().top
            }, 2000);

    }


    window.setTimeout( scrolltodiv, 5000 );
});
about 4 years ago · Juan Pablo Isaza Denunciar

0

$(function(){
    setTimeout(function(){
      animate("#idorclass" ,2000)
    }, 5000)
})

const animate = (idorclass, animval)=>{
  $('html, body').animate({
    scrollTop: $(idorclass).offset().top
 }, animval);
}

also dynamic function that you can reuse

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