Created
August 21, 2012 17:04
-
-
Save ryankinal/3417348 to your computer and use it in GitHub Desktop.
jQuery "second click" plugin
This file contains 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 characters
// Untested, off-the-cuff | |
$.fn.secondClick = function(handler) | |
{ | |
var flag = false; | |
$(this).click(function(e) { | |
if (flag) | |
{ | |
return handler(e); | |
flag = false; | |
} | |
else | |
{ | |
flag = true; | |
} | |
return false; | |
}); | |
return this; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment