Skip to content

Instantly share code, notes, and snippets.

@daveespionage
Created September 20, 2012 11:09
Show Gist options
  • Save daveespionage/3755259 to your computer and use it in GitHub Desktop.
Save daveespionage/3755259 to your computer and use it in GitHub Desktop.
Simple touch support detection for javascript
/*=========== Touch support detection ===========*/
(function detect_touch_support(){
if ("ontouchend" in document) {
$('html').addClass('touch');
} else {
$('html').addClass('no-touch');
}
}());
@daveespionage
Copy link
Author

From code working with @LukeAskew

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