if(screen.width<768 ){
alert("这是手机");
if(document.body.clientWidth>window.screen.width){
alert("屏幕是横着放的");
}else{
alert("屏幕是竖着放的");
}
if(screen.width<768 ){
alert("这是手机");
if(document.body.clientWidth>window.screen.width){
alert("屏幕是横着放的");
}else{
alert("屏幕是竖着放的");
}
转载于:https://my.oschina.net/lilugirl2005/blog/397588