JS判断屏幕宽度执行相应代码
以下这段代码是判断屏幕宽度最大宽度767px
<script>if(window.matchMedia("(max-width: 767px)").matches){window.location.href='/lists/34.html';}else {document.write('<script type="text/javascript" src="/static/page.js"><\/script>');}</script>
还有一种方式
<script>if(window.matchMedia("(max-width: 767px)").matches){// window.location.href='/lists/34.html';}else {window.location.href='/lists/1.html';}</script>