How can I scroll to a specific location on the page using jquery?

Asked

Viewed 45 times

1

It is possible to scroll to a specific location on the page using jQuery?

The location I want to roll needs to have:

<a name="#123">here</a>

Or you can just pass a specific DOM ID?

1 answer

1


Try this:

$("#botao").on('click',function() {
    $('html, body').animate({
        'scrollTop' : $("#div_para_scrollar").position().top
    });
});

Browser other questions tagged

You are not signed in. Login or sign up in order to post.