Last active
August 26, 2017 19:57
-
-
Save Tahseenm/5691e9bd81b53792c9dc7d160fcbc892 to your computer and use it in GitHub Desktop.
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
/** | |
* Check if device has a touch screen | |
* | |
* @returns {boolean} | |
*/ | |
function isTouchDevice() { | |
return !!(window.ontouchstart && navigator.maxTouchPoints > 0) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment