Skip to content

Instantly share code, notes, and snippets.

@ryankinal
Created August 21, 2012 17:04
Show Gist options
  • Save ryankinal/3417348 to your computer and use it in GitHub Desktop.
Save ryankinal/3417348 to your computer and use it in GitHub Desktop.
jQuery "second click" plugin
// 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