PC端判斷螢幕寬度到達手機寬度的時候,直接跳轉手機頁面
阿新 • • 發佈:2018-12-30
<script> // //判斷螢幕寬度到達手機寬度的時候,直接跳轉手機頁面 // window.addEventListener("resize", function() { // if (/Android|ios|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { // window.location.href = 'http://103.47.137.221/mob/login.html'; // } // }) </script> <script type="text/javascript"> (function() { var sUserAgent = navigator.userAgent; if (sUserAgent.indexOf('Android') > -1 || sUserAgent.indexOf('iPhone') > -1 || sUserAgent.indexOf('iPad') > -1 || sUserAgent.indexOf('iPod') > -1 || sUserAgent.indexOf('Symbian') > -1) { location.href = 'http://103.47.137.221/mob/login.html'; } else { } })(); </script>