Skip to content

Instantly share code, notes, and snippets.

View mrkmg's full-sized avatar

Kevin mrkmg

View GitHub Profile
@mrkmg
mrkmg / jquery.onhold.js
Created October 4, 2011 20:21
jQuery On Hold event
(function( $ ){
$.fn.onHold= function(time,action) {
this.data('onHold_selected',false);
this.mousedown(function(){
$(this).data('onHold_selected',true);
var object = this;
setTimeout(function(){
if($(object).data('onHold_selected')){
action();
}