Skip to content

Commit 14d8aed

Browse files
committed
判断是否是移动设备访问
1 parent 33ac010 commit 14d8aed

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

isMobileUserAgent.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* @description 判断是否是移动设备访问
3+
* @author 未知
4+
*/
5+
6+
function isMobileUserAgent(){
7+
return (/iphone|ipod|android.*mobile|windows.*phone|blackberry.*mobile/i.test(window.navigator.userAgent.toLowerCase()));
8+
}

0 commit comments

Comments
 (0)