jQuery Mobile swiperightEvent

jQuery Mobile 事件jQuery Mobile Events

Example

Swipe right horizontally on the <p> element to hide it:

$("p").on("swiperight",function(){
  $(this).hide();
});

Try it Yourself »

Definition and Usage

The swiperight event is triggered when you drag horizontally to the right more than 30px (and vertically less than 75px) within one second.

Related Events:

  • swipe- Refers to an event triggered when you drag more than 30px horizontally or less than 75px vertically within one second.
  • swipeleft- Refers to an event triggered when you drag horizontally to the left more than 30px within one second.

Syntax

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

Parameter Description
function(event) Required. Specifies the function to execute when the swiperight event is triggered.

The function has an optional event object, which can be any jQuery event property (e.g., event.target, event.type, etc.). For more information, see thejQuery Events Reference Manual 。


实例

More Examples

Event Object
Use the event.target property to return the DOM element that triggered the swiperight event.


jQuery Mobile 事件jQuery Mobile Events

Other Extensions