$(window).scroll(function (event) {
// Do something when the page is scrolled
}
Syntax
Trigger the scroll event for the selected elements:
$(selector).scroll()
Attach a function to the scroll event:
$(selector).scroll(function)
$( "#target" ).scroll(function() {
$( "#log" ).append( "<div>Handler for .scroll() called.</div>" );
});