项目作者: phuong

项目描述 :
Capture mousedown and hold, fire event during hold event
高级语言: JavaScript
项目地址: git://github.com/phuong/jqueryClickAndHold.git
创建时间: 2017-04-12T15:05:49Z
项目社区:https://github.com/phuong/jqueryClickAndHold

开源协议:MIT License

下载


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.

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

More options

  1. $('button').clickAndHold({
  2. timeout: 200,
  3. onHold: function(event, times) {
  4. console.log("Bam");
  5. },
  6. onRelease: function(event) {
  7. console.log("Reload");
  8. }
  9. });