我正在尝试删除一个javascript事件,只针对处于横向模式的手机。我尝试过使用CSS媒体查询,但没有成功,但我找不到正确的答案。
例如,如何涵盖至少在iphone4和三星Galaxy3上检测横向模式的代码?两者都是移动设备,但具有不同的维度。
是否有仅针对横向移动设备的媒体查询解决方案?
有没有只针对横向移动设备的javascript解决方案?
发布于 2015-01-05 15:42:55
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
/* Styles */
}
/* Smartphones (portrait) ----------- */
@media only screen
and (max-width : 320px) {
/* Styles */
}https://stackoverflow.com/questions/23787395
复制相似问题