Last active
August 29, 2015 14:00
-
-
Save fentas/11087280 to your computer and use it in GitHub Desktop.
prevent ghost click issue - tap event triggered for twice (jquery mobile)
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 characters
if ( typeof lastTabEvent !== 'undefined' && +new Date() - 500 < lastTabEvent) return; else lastTabEvent = +new Date(); | |
/* | |
$('...').bind('tap', function(e) { | |
if ( typeof lastTabEvent !== 'undefined' && +new Date() - 500 < lastTabEvent) return; else lastTabEvent = +new Date(); | |
// ... | |
}); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
prevent next tap event for 500ms