Created
June 7, 2017 20:45
-
-
Save codeZoner/ee2cab4fb0e28a9673bf15a77187c0dc to your computer and use it in GitHub Desktop.
Check If Mobile User Agent - Jquery
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
//https://stackoverflow.com/questions/3514784/what-is-the-best-way-to-detect-a-mobile-device-in-jquery#answer-3540295 | |
function isMobileUserAgent(){ | |
var isMobile = false; //initiate as false | |
// device detection | |
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { | |
isMobile = true; | |
} | |
return isMobile; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment