Created
November 4, 2021 07:01
-
-
Save BekNaji/c84f96d9c5d7e45de91e18dfb247f5e2 to your computer and use it in GitHub Desktop.
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
function isDoubleClicked(element) | |
{ | |
//if already clicked return TRUE to indicate this click is not allowed | |
if (element.data("isclicked")) return true; | |
//mark as clicked for 1 second | |
element.data("isclicked", true); | |
setTimeout(function () { | |
element.removeData("isclicked"); | |
}, 1000); | |
//return FALSE to indicate this click was allowed | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment