Created
September 20, 2012 11:09
-
-
Save daveespionage/3755259 to your computer and use it in GitHub Desktop.
Simple touch support detection for javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*=========== 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
From code working with @LukeAskew