jQuery Mobile Touch Events


Touch events are triggered when the user touches the screen (page).

lamp Touch events can also be applied on desktop computers:Click or swipe the mouse!


jQuery Mobile Tap

The tap event is triggered when the user taps an element.

Example: When you tap the <p> element, hide the current <p> element:

Example

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

Try it Yourself »


jQuery Mobile Taphold (Long Press)

The taphold (long press) event is triggered after tapping and holding (for about one second).

Example

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

Try it Yourself »


jQuery Mobile Swipe

The swipe event is triggered when the user drags horizontally more than 30PX, or vertically less than 20px, within one second.

Example

$("p").on("swipe",function(){
$("span").text("Swipe detected!");
});

Try it Yourself »


jQuery Mobile Swipe Left

The swipe left event is triggered when the user drags the element to the left by more than 30px:

Example

$("p").on("swipeleft",function(){
alert("Swipe left!");
});

Try it Yourself »


jQuery Mobile Swipe Right

The swipe right event is triggered when the user drags the element to the right by more than 30px:

Example

$("p").on("swiperight",function(){
alert("Swipe right!");
});

Try it Yourself »
Other Extensions