modernizr.mobile
Modernizr mobile test based in javascript code from http://detectmobilebrowsers.com/
Usage:
if (Modernizr.mobile) { ... };
Where true
is a mobile device.
To add support for tablets, add |android|ipad|playbook|silk
to the first regex.