// 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);
}
);