There is no built-in function for jQuery that allows you to detect start or stop scroll events.
There are several plugins that allow you to use this functionality, try this one .
Then you can change your code:
$(window).on('scrollstart', function() {
console.log("ciao");
});
source
share