isMobile
Tiny.js 使用了 isMobile,你可以通过 Tiny.isMobile
获得,举个栗子:
// 是否是 iPhone 设备
var isIPhone = Tiny.isMobile.apple.phone
//=> true
// 是否是 Android 设备
var isAndroid = Tiny.isMobile.android.phone
//=> false
所有类型
# Apple devices
apple
phone
ipod
tablet
device # any mobile Apple device
# Android devices
android
phone
tablet
device # any mobile Android device
# Amazon Silk devices (also passes Android checks)
amazon
phone
tablet
device
# Windows devices
windows
phone
tablet
device # any mobile Windows device
# "Other" devices
other
blackberry
blackberry10
opera # Opera Mini
firefox
chrome
device # any "Other" device
# Specific seven inch devices
seven_inch
# Nexus 7
# Kindle Fire
# Nook Tablet 7 inch
# Galaxy Tab 7 inch
# Aggregate Groupings
any # any device matched
phone # any device in the 'phone' groups above
tablet # any device in the 'tablet' groups above