Skip to content

Instantly share code, notes, and snippets.

@squarefeet
Created February 1, 2012 11:21
Show Gist options
  • Save squarefeet/1716620 to your computer and use it in GitHub Desktop.
Save squarefeet/1716620 to your computer and use it in GitHub Desktop.
// Try putting this in your touchstart...
// Where 'e' is your event.
var that = this,
point = e.changedTouches[0],
target;
target = document.elementFromPoint(point.pageX, point.pageY);
if(target.nodeType === 3) target = target.parentNode;
if(target.tagName !== 'SELECT' && target.tagName !== 'INPUT' && target.tagName !== 'TEXTAREA') {
e.preventDefault();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment