Closed ghost closed 3 years ago
Hey guys
$('html, body').animate({scrollTop: 0},'slow');
: is perfectly valid code for an animated scroll
try this code:
Which doesn't help in explaining why it doesn't work for @abhijeet-cn, sadly. Is the problem related to halfmoon? Or can you re-create it without the css?
Hello,
I was having the same issue. I found that you must scroll not on the body
but on .content-wrapper
, like so:
$('.content-wrapper').animate({scrollTop: '0px'}, 1000);
This occurs thanks to how Halfmoon structures your page where the body
will always take up exactly the full visible screen area and the page contents are themselves wrapped in .page-wrapper > .content-wrapper
.
Thanks this worked for me, I am closing the issue.
Hey, I am sure why this is happening. I was trying to create a scroll to top button and tried a lot of solutions from StackOverflow but nothing seems to work.
$("html, body").animate({ scrollTop: 0 }, "slow");
Any help on this is appreciated. Thanks