Created
March 12, 2019 20:31
-
-
Save DrYurets/60dc4947c4c4c301608d4d573ad0ba4a 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
function is_touch_device() { | |
return !!("ontouchstart" in window) ? 1 : 0; | |
} | |
/* Mobile detection - Touch desktop device safe! */ | |
function isMobile() { | |
try{ document.createEvent("TouchEvent"); return true; } | |
catch(e){ return false; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment