修复判断ipad代码
This commit is contained in:
@@ -149,7 +149,7 @@ const formatTime = (timestamp, fmt) => {//吧时间戳转为YYYY-MM-DD hh:mm:ss
|
|||||||
const isMoible = () => {//判断是否是移动端
|
const isMoible = () => {//判断是否是移动端
|
||||||
let is_mobile = navigator.userAgent.toLowerCase().match(/(ipad|ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|wince)/i) != null;
|
let is_mobile = navigator.userAgent.toLowerCase().match(/(ipad|ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|wince)/i) != null;
|
||||||
// alert(navigator.userAgent.toLowerCase())
|
// alert(navigator.userAgent.toLowerCase())
|
||||||
var isiPad = (navigator.maxTouchPoints && navigator.maxTouchPoints > 0);
|
var isiPad = (navigator.maxTouchPoints && navigator.maxTouchPoints > 1);
|
||||||
// if (is_mobile) {
|
// if (is_mobile) {
|
||||||
// return true//判断是否在正则内
|
// return true//判断是否在正则内
|
||||||
// } else if(window.matchMedia("(pointer:fine)").matches){
|
// } else if(window.matchMedia("(pointer:fine)").matches){
|
||||||
@@ -160,7 +160,7 @@ const isMoible = () => {//判断是否是移动端
|
|||||||
if (is_mobile) {
|
if (is_mobile) {
|
||||||
return true//判断是否在正则内
|
return true//判断是否在正则内
|
||||||
} else{
|
} else{
|
||||||
isiPad//判断触摸点
|
return isiPad//判断触摸点
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user