Created
May 11, 2013 09:47
-
-
Save foo9/5559464 to your computer and use it in GitHub Desktop.
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
| var isTouch = (function () { | |
| var div = document.createElement('div'); | |
| div.setAttribute('ontouchstart', 'return'); | |
| return typeof div.ontouchstart === 'function'; | |
| }()); | |
| var isTouch2 = ('ontouchstart' in window); | |
| alert(isTouch + ", " + isTouch2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment