When you load (enter) a page automatically move the scroll bar to a specific element without clicking anything

1

I have already been able to click on some link etc, but I would like that when entering a page the vertical scrollbar of the navigator goes down to a specific element, without having to click anything.

    
asked by anonymous 21.07.2016 / 01:11

1 answer

5

Pretty simple, here it goes:

$(document).ready(function () { //Função para que o script comece quando a página carregar
    $('html, body').animate({
        scrollTop: $('DIV PARA QUAL A PÁGINA IRÁ').offset().top
    }, 'slow');
});

Code taken from link

    
21.07.2016 / 01:15