phuong / jqueryClickAndHold

Capture mousedown and hold, fire event during hold event

Home Page:https://phuong.github.io/jqueryClickAndHold/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jqueryClickAndHold

Capture mousedown and hold, fire event during hold event. Demo

Usage

Basic usage

Press button and hold, this event will fire until button is released.

    $('button').clickAndHold(function (e, n) {
        console.log("Call me baby ", n);
    });

More options

    $('button').clickAndHold({
        timeout: 200,
        onHold: function(event, times) {
            console.log("Bam");
        },
        onRelease: function(event) {
            console.log("Reload");
        }
    });

About

Capture mousedown and hold, fire event during hold event

https://phuong.github.io/jqueryClickAndHold/

License:MIT License


Languages

Language:JavaScript 78.2%Language:HTML 21.8%