on-hold
Repeated events for pressing and holding down DOM elements.
install
npm install on-hold
example
Holding down the button will call the function repeatedly:
var onHold = var btn = documentbtntextContent = 'Press and Hold' documentbody
api
onHold(element, [{ wait: 500, interval: 200 }], action)
element
DOM element to attach events to.
options
wait
: initial time in ms to hold down before repeating action.interval
: interval in ms between repeated actions after inital hold down.
action
Event handler function.
license
MIT