Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

265
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda