css代码判断横竖屏
/* 设备竖屏时调用该段css代码 */
@media all and (orientation : portrait){
.class_name{
/*竖屏样式*/
}
}
/* 设备横屏时调用该段css代码 */
@media all and (orientation : landscape){
.class_name{
/*横屏样式*/
}
}
jQuery判断横竖屏
if (window.orientation == 90 || window.orientation == -90) {
// Andriod横屏,iPad、iPhone竖屏
//业务逻辑
} else if (window.orientation == 0 || window.orientation == 180) {
// Andriod竖屏,iPad、iPhone横屏
//业务逻辑
}