Revisions
-
ncr revised this gist
Jun 3, 2010 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ Code $("button").single_double_click(function () { alert("Try double-clicking me!") }, function () { alert("Double click detected, I'm hiding") $(this).hide() }) -
ncr revised this gist
Jun 3, 2010 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,14 +5,14 @@ jQuery.fn.single_double_click = function(single_click_callback, double_click_callback, timeout) { return this.each(function(){ var clicks = 0, self = this; jQuery(this).click(function(event){ clicks++; if (clicks == 1) { setTimeout(function(){ if(clicks == 1) { single_click_callback.call(self, event); } else { double_click_callback.call(self, event); } clicks = 0; }, timeout || 300); -
ncr revised this gist
Jun 2, 2010 . 1 changed file with 10 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,13 @@ Code $("button").single_double_click(function () { alert("Try double click me!") }, function () { alert("Double Click Detected, I'm hiding") $(this).hide() }) Markup <button>Click Me!</button> -
ncr revised this gist
Jun 2, 2010 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ $("button").single_double_click(function(){ alert("Try double click me!") }, function(){ alert("Double Click Detected, I'm hiding") $(this).hide() }) -
ncr revised this gist
May 21, 2010 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ jQuery.fn.single_double_click = function(single_click_callback, double_click_cal return this.each(function(){ var clicks = 0, self = this; jQuery(this).click(function(){ clicks++; if (clicks == 1) { setTimeout(function(){ if(clicks == 1) { -
ncr revised this gist
May 21, 2010 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ jQuery.fn.single_double_click = function(single_click_callback, double_click_callback, timeout) { return this.each(function(){ var clicks = 0, self = this; jQuery(this).click(function(){ clicks ++; if (clicks == 1) { setTimeout(function(){ -
ncr revised this gist
May 21, 2010 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,18 @@ // Author: Jacek Becela // Source: http://gist.github.com/399624 // License: MIT jQuery.fn.single_double_click = function(single_click_callback, double_click_callback, timeout) { return this.each(function(){ var clicks = 0, self = this; $(this).click(function(){ clicks ++; if (clicks == 1) { setTimeout(function(){ if(clicks == 1) { single_click_callback.apply(self); } else { double_click_callback.apply(self); } clicks = 0; }, timeout || 300); -
ncr created this gist
May 13, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ jQuery.fn.single_double_click = function(single_click_callback, double_click_callback, timeout) { return this.each(function(){ var clicks = 0; $(this).click(function(){ clicks ++; if (clicks == 1) { setTimeout(function(){ if(clicks == 1) { single_click_callback(); } else { double_click_callback(); } clicks = 0; }, timeout || 300); } }); }); }