JQuery Scroll () event method triggers the scroll event when user scrolls in the specified element and also specifies number of times a scroll event occurs if the function parameter is set.
Statement to count the occurrence of scroll event.
$("span").text(x += 1);
Let us see an example for catching scroll method in jquery. In the below example we have a small div that moves up and down on user specifications. Following is the source code.