Touch class provides support to handle the touch event like tap, double tap, tap hold, etc..,
let node: HTMLElement;
let touchObj: Touch = new Touch({
element: node,
tap: function (e) {
// tap handler function code
}
tapHold: function (e) {
// tap hold handler function code
}
scroll: function (e) {
// scroll handler function code
}
swipe: function (e) {
// swipe handler function code
}
});
Customize the swipe event configuration.
Defaults to { swipeThresholdDistance: 50 }
number
Specifies the time delay for tap hold.
Defaults to 750
number
Specifies the time delay for tap.
Defaults to 350
Adds the handler to the given event listener.
Parameter | Type | Description |
---|---|---|
eventName | string |
A String that specifies the name of the event |
handler | Function |
Specifies the call to run when the event occurs. |
Returns void
Bind property changes immediately to components
Returns void
To destroy the touch instance.
Returns void
Removes the handler from the given event listener.
Parameter | Type | Description |
---|---|---|
eventName | string |
A String that specifies the name of the event to remove |
handler | Function |
Specifies the function to remove |
Returns void
Specifies the callback function for scroll event.
Specifies the callback function for swipe event.
Specifies the callback function for tap event.
Specifies the callback function for tapHold event.