Role até o elemento jQuery
$('html, body').animate({
scrollTop: $("#grepperRocks").offset().top
});
Spyder
$('html, body').animate({
scrollTop: $("#grepperRocks").offset().top
});
$("a[href='#top']").click(function() {
$("html, body").animate({ scrollTop: 0 }, "slow");
return false;
});
$(window).scroll(function (event) {
var scroll = $(window).scrollTop();
// Do something
});
var top = ($(window).scrollTop() || $("body").scrollTop());
var scroll = $(window).scrollTop();
// yada
$("html").scrollTop(scroll);
// Get the current scroll position
let scrollValue = jQuery(window).scrollTop();
console.log('Scroll value: ' + scrollValue);
// Keep updating the value of the scroll position in the variable
// when a user scrolls it will be updated.
jQuery(window).scroll(
function()
{
let scrollValue = jQuery(window).scrollTop();
console.log('Scroll value: ' + scrollValue);
}
);