jQuery Mobile scrollstart event
Example
Pop up a message when the page starts scrolling:
$(document).on("scrollstart",function(){
alert("Start scrolling!");
});
Try it »
Definition and Usage
scrollstart is an event triggered when a page starts scrolling.
**Note:** Apple devices freeze DOM operations during scrolling and execute these DOM operations in a queue when scrolling ends. We are currently researching ways to let Apple devices execute DOM operations before scrolling begins.
Tip: This event is usually attached to the document.
Tip: scrollstop The 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. |
该函数有可选的事件对象 ,事件对象可以是任何 jQuery 事件属性 (例如 event.target, event.type, 等)。更多信息请查阅 [jQuery 事件参考手册](/jquery/jquery-ref-events.html) 。 |
More examples
Scroll count
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 Events