Last active
March 23, 2020 03:13
-
-
Save nanmu42/576357bba28979468e79bb1e4988b67f to your computer and use it in GitHub Desktop.
Javascript: Does the device have a touchscreen?
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
function isTouchDevice() { | |
return 'ontouchstart' in window | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment