THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

jQuery swiperight Event

jQuery Mobile Events jQuery Mobile Events

Example

Swipe over a <p> element in the right direction to hide it:

$("p").on("swiperight",function(){
  $(this).hide();
});
Try it yourself »

Definition and Usage

The swiperight event is triggered when the user press down and swipes over an element in the right direction (by more than 30px horizontally and less than 75px vertically).

Related events:

  • swipe - triggered when the user swipes over an element horizontally (left and right direction)
  • swipeleft - triggered when the user swipes over an element in the left direction

Syntax

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

Parameter Description
function(event) Required. Specifies the function to run when the swiperight event occurs.

The function has an optional event object, which can contain any jQuery event properties (e.g. event.target, event.type, etc.) See jQuery Events Reference for more information.

Examples

Try it Yourself - Examples

The event object
Using the event.target property to return which DOM element that triggered the swiperight event.


jQuery Mobile Events jQuery Mobile Events