Created
December 10, 2015 13:06
-
-
Save Ugarz/8fc01005b87b54ef1948 to your computer and use it in GitHub Desktop.
Check if your device if mobile or tablet in Javascript
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
window.mobileAndTabletcheck = function() { | |
var check = false; | |
(function(a) { | |
if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a) || | |
if (window.mobileAndTabletcheck == true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment