【问题标题】:how to target landscape mode in different mobile phones如何在不同的手机中定位横向模式
【发布时间】:2014-05-21 15:17:40
【问题描述】:

我正在尝试仅删除处于横向模式的手机的 javascript 事件。我尝试使用 CSS 媒体查询失败,但我找不到正确的答案。

例如,如何覆盖检测至少 iphone4 和三星 Galaxy 3 横向模式的代码?两者都是移动设备,但尺寸不同。

是否有仅针对横向移动设备的媒体查询解决方案?

是否有仅针对横向移动设备的 javascript 解决方案?

【问题讨论】:

    标签: javascript iphone mobile media-queries samsung-mobile


    【解决方案1】:
    /* 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 */
    }
    

    【讨论】:

      猜你喜欢
      • 2017-07-10
      • 1970-01-01
      • 2021-06-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多