Last active
October 9, 2016 19:32
-
-
Save englishextra/3cb22aab31a52b6760b5921e4fe8db95 to your computer and use it in GitHub Desktop.
add touch support class
This file contains hidden or 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
/*! | |
* add touch support class | |
* gist.github.com/englishextra/3cb22aab31a52b6760b5921e4fe8db95 | |
* jsfiddle.net/englishextra/z5xhjde8/ | |
*/ | |
var earlyHasTouch; | |
(function (d, s) { | |
if (d) { | |
var c = "ontouchstart" in d ? s : "no-" + s; | |
earlyHasTouch = c; | |
d.classList.add(c); | |
} | |
} | |
(document.documentElement || "", "touch")); | |
alert(earlyHasTouch); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment