jquery scroll to top
$("my-element").click(function () {
$("html, body").animate({
scrollTop: 0
}, 1000)
})
jquery scroll to top
$("my-element").click(function () {
$("html, body").animate({
scrollTop: 0
}, 1000)
})
scroll to top jquery
window.scrollTo({top: 0, behavior: 'smooth'});
reference : https://stackoverflow.com/questions/15935318/smooth-scroll-to-top
jquery on scroll down
Check current scrollTop vs previous scrollTop
var lastScrollTop = 0;
$(window).scroll(function(event){
var st = $(this).scrollTop();
if (st > lastScrollTop){
// downscroll code
} else {
// upscroll code
}
lastScrollTop = st;
});
scrool to top jquerry
$("a[href='#top']").click(function() {
$("html, body").animate({ scrollTop: 0 }, "slow");
return false;
});
jquery get document scrolltop
var top = ($(window).scrollTop() || $("body").scrollTop());
scroll to top in jquery
window.scrollTo({ top: 100, left: 100, behavior: 'smooth' });
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