jQuery Mobile scrollstartEvent

jQuery Mobile 事件jQuery Mobile Events

Examples

Pop up a message when the page starts scrolling:

$(document).on("scrollstart",function(){
alert("Start scrolling!");
});

Try it Yourself »

Definition and Usage

The scrollstart event is triggered when the page starts scrolling.

Note:Apple devices freeze DOM operations while scrolling, and execute these DOM operations in a queue when scrolling ends. We are currently researching ways to make Apple devices perform DOM operations before scrolling starts.

Tip:This event is usually attached to the document.

Tip: scrollstopThe event is triggered when scrolling ends.


Syntax

$("selector").on("scrollstart",function(event){...})

Parameters Description
function(event) Required. Specifies the function to execute when the scrollstart event is triggered.

This function has an optional event object, which can be any jQuery event property (e.g., event.target, event.type, etc.). For more information, please refer tojQuery Event Reference Manual 。


实例

More Examples

Scroll count statistics
Count the number of times the scrollstart event is triggered.

Event object
Use the event.target property to return the DOM element that triggered the scrollstart event.


jQuery Mobile 事件jQuery Mobile Events

Other Extensions