Created
June 7, 2014 18:12
-
-
Save psynewave/144f6dd9e5d2dae23cd0 to your computer and use it in GitHub Desktop.
Mobile Device JS Detection using Touch Event
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 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