Skip to content

Instantly share code, notes, and snippets.

@swape
Created May 21, 2013 10:20
Show Gist options
  • Save swape/5618813 to your computer and use it in GitHub Desktop.
Save swape/5618813 to your computer and use it in GitHub Desktop.
Mobile detector
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ){
// do something for mobile browsers
}
@swape
Copy link
Author

swape commented May 22, 2013

for windows mobile and other windows touch devices you can add iemobile|Touch to the list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment