shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
onDrag
Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.dom.on
Detect drag “gesture” with the mouse or touch
Params
- $elm*-HTMLElement
The HTMLElement on which to detect the swipe
- cb*-Function
The function to call on swipe. The callback function has as parameter an object that containthe swipe direction like left, right, up and down
- threshold100Number
The swipe threshold
Example
import { onDrag } from '@blackbyte/sugar/dom'
onDrag($elm, (drag) => {
// do something...
});Settings
- maxSpeed0.01Number
The maximum speed
Todo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space