Skip to content

Instantly share code, notes, and snippets.

@enwin
Created December 14, 2012 15:15

Revisions

  1. enwin created this gist Dec 14, 2012.
    9 changes: 9 additions & 0 deletions touches.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    $('a').bind('touchstart touchend touchcancel click',function(e){
    // prevent click on touch actions
    e.preventDefault();

    // stop script if touchstart, only execute the script on touchend (nicer)
    e.type === touchstart && return

    alert('here');
    });