javascript scroll to top of page
//Instant scroll to top of page
window.scrollTo(0, 0);
javascript scroll to top of page
//Instant scroll to top of page
window.scrollTo(0, 0);
javascript go to top of page
window.scroll({
top: 0,
left: 0,
behavior: 'smooth'
});
scroll down up js
var lastScrollTop = 0;
// element should be replaced with the actual target element on which you have applied scroll, use window in case of no target element.
element.addEventListener("scroll", function(){ // or window.addEventListener("scroll"....
var st = window.pageYOffset || document.documentElement.scrollTop; // Credits: "https://github.com/qeremy/so/blob/master/so.dom.js#L426"
if (st > lastScrollTop){
// downscroll code
} else {
// upscroll code
}
lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling
}, false);
scroll to top
$("#scroll_icon").click(function()
{
jQuery('html,body').animate({scrollTop:0},2000);
})
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us