The mobile swipe component handles user horizontal swiping events.
To register a swipe event for a given jQuery selector, use the kendoMobileSwipe
jQuery plugin method.
<div>
<p>Foo</p>
</p>Bar</p>
</div>
<script>
$("p").kendoMobileSwipe(function(e) {
console.log("You swiped" + e.target.text() );
});
</script>
The event handler accepts a parameter with the following fields:
target | The DOM element which was swiped |
---|---|
direction | The swipe direction. Can be either left or right . |
drag | An instance of the kendo.Drag component, containing additional information about the drag event sequence, that generated the swipe. |
The swipe event criteria (minimum horizontal distance, maximum vertical deviation, timing, and swipe surface) can be configured by passing an additional parameter to the kendoMobileSwipe
method. For more details, see the configuration section.
<div>
<p>Foo</p>
</p>Bar</p>
</div>
<script>
$("p").kendoMobileSwipe(function(e) {
console.log("You swiped" + e.target.text() );
}, { minXDelta: 200, maxDuration: 100 });
</script>