2
I did not find an answer or in the jQuery documentation. Because when I use element "body" for Animate with the scrollTop property I want to animate does not work.
Follows 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’d still like to know why html and not the body?
put the other html codes to analyze please
– Wilson Rosa Gomes
Anderson your Body had height? Make sure your Body and HTML have values in
height
, guyhtml, body {height:100%}
– hugocsl