Methods
offSwipe(targets, directionopt, nullable, handleropt, nullable, eventNameSpaceopt, nullable) → {Number}
Removes (a) handler(s) for a swipe gesture from (an) element(s).
Normally all directions are removed individually, but if you leave out direction
all directions are removed at once.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
targets |
EventTarget | Array.<EventTarget> | the target(s) to remove event handlers from |
||
direction |
String |
<optional> <nullable> |
null | the direction to remove => up/down/left/right, if empty, all directions are removed |
handler |
function |
<optional> <nullable> |
null | a specific callback function to remove |
eventNameSpace |
String |
<optional> <nullable> |
'annex-swipe' | event namespace to remove |
Throws:
-
error in case no targets are defined
-
error in case unknown direction is defined
-
error in case a defined handler is not a function
-
error in case targets are not all usable event targets
-
error in case delegations are missing viable ancestor targets
Returns:
the number of handlers actually removed by the function call, may also be 0 if nothing matched
- Type
- Number
Example
offSwipe(slider, 'right');
offSwipe(slider, 'left', fSpecialHandler, 'foobar-prev');
offSwipe(slider);