Skip to content

Instantly share code, notes, and snippets.

@danklammer
Forked from daveespionage/touch_detect.js
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danklammer/ea6feb0866484bceeb6f to your computer and use it in GitHub Desktop.
Save danklammer/ea6feb0866484bceeb6f to your computer and use it in GitHub Desktop.
/*=========== Touch support detection ===========*/
(function detect_touch_support(){
if ("ontouchend" in document) {
$('html').addClass('touch');
} else {
$('html').addClass('no-touch');
}
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment