判断使用设备是PC还是phone
<script type="text/javascript"> //如果是手机设备,则.. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) { window.location.href = "http://www."; } </script> <style type="text/css"> @media screen and (max-width: 600px) { /*当屏幕尺寸小于600px时,应用下面的CSS样式*/ .self-box{display: none !important;} .index-banner{display: none !important;} } </style>
//视图锁定
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width, minimal-ui">