Skip to content

Instantly share code, notes, and snippets.

@lifedraft
Created February 20, 2014 14:38
Show Gist options
  • Save lifedraft/9115070 to your computer and use it in GitHub Desktop.
Save lifedraft/9115070 to your computer and use it in GitHub Desktop.
Execute some action on click/touchend after the second tap on an element.
if Modernizr.touch
_active = null
$context.bind 'touchend', (event) ->
_active = null
links = $context.find('.contents-item a').bind 'touchend', ->
if _active != this
_active = this
return false
if _active == this
// {execute my code}
return false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment