I have not found an answer to the jQuery documentation. When I use body element for the animate with the scrollTop property I want to animate does not work.
Follow my code
function scrollPlacar() {
$('body').animate({
scrollTop: $(".placar").offset().top
}, 1000);
}
But when I do it that way.
function scrollPlacar() {
$('html').animate({
scrollTop: $(".placar").offset().top
}, 1000);
}
It works perfectly, but I still wanted to know why html and not body ?