JS for smooth scroll to the bottom of the page
With pure JS:
window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' })
and to the top as:
window.scrollTo({ top: 0, behavior: 'smooth' })
There is no such thing as scrollToBottom
. Try this:
$("html, body").animate({ scrollTop: document.body.scrollHeight }, "slow");