Skip to content

Instantly share code, notes, and snippets.

@fentas
Last active August 29, 2015 14:00
Show Gist options
  • Save fentas/11087280 to your computer and use it in GitHub Desktop.
Save fentas/11087280 to your computer and use it in GitHub Desktop.
prevent ghost click issue - tap event triggered for twice (jquery mobile)
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();
// ...
});
*/
@fentas
Copy link
Author

fentas commented Apr 19, 2014

prevent next tap event for 500ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment