- Source:
Entry point for gesture.
Methods
(static) enableTap() → {Craft.Core.Gesture.Swipe}
- Source:
Enable tap
Example
Craft.Core.Gesture.enableTap({
target : this.view.querySelector('#id'),
tap : tapHandler
});
Parameters:
Name | Type | Description |
---|---|---|
options.target |
Element | target element |
options.tap |
function | tap handler |
Returns:
swipe handling instance (see code)
- Type
- Craft.Core.Gesture.Swipe
(static) enableSwipe() → {Craft.Core.Gesture.Tap}
- Source:
Enable swipe
Example
Craft.Core.Gesture.enableSwipe({
target : this.view.querySelector('#id'),
left : swipeLeftHandler,
right : swipeRgihtHandler,
up : swipeUpHandler,
down : swipeDownHandler,
});
Parameters:
Name | Type | Description |
---|---|---|
options.target |
Element | target element |
options.left |
Number | swipe left hander |
options.right |
Number | swipe right hander |
options.up |
Number | swipe up hander |
options.down |
Number | swipe down hander |
options.DIFF_THRESHOLD |
Number | movement should more than this |
options.TIME_THRESHOLD |
Number | time should be more than this |
options.MULTI_THRESHOLD |
Number | last multi-touch more than before |
Returns:
tap handling instance (see code)
- Type
- Craft.Core.Gesture.Tap