最简单的办法判断窗口的宽度:if (window.innerWidth)winWidth = window.innerWidth;else if ((document.body) && (document.body.clientWidth))winWidth = document.body.clientWidth;if(winWidth <= 720){ alert("手机屏幕");}
是否可以使用ip进行判断呢~