適配

1.判斷當前設備
if (/android/i.test(navigator.userAgent)){

  alert('android')
}

if (/ipad|iphone|mac/i.test(navigator.userAgent)){

  alert('ios')
}

2.獲取當前設備尺寸android

console.log(window.screen.width,window.screen.height)
相關文章
相關標籤/搜索