var
isMobile =
false
;
// 检测userAgent
if
( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
isMobile =
true
;
}
if
(isMobile){
//移动端的处理逻辑
}