【问题标题】:iPad physical orientation doesn't have any effectiPad物理方向没有任何影响
【发布时间】:2012-10-06 21:10:10
【问题描述】:

我了解“纵向”iPad 方向对应于 1024 像素宽的窗口,“横向”对应于 768 像素。

但是当我访问我的网页时,无论我的 iPad 方向如何,我的宽度始终相同。

左下角红色数字代表jQuery('body').width()connected到resize()JS事件的值。为什么纵向和横向模式下的值保持不变?

【问题讨论】:

    标签: html ipad orientation


    【解决方案1】:

    您需要将initial-scale=1 添加到您的元viewport 标签。请参阅此相关问题:Viewport meta tag for iOS devices

    【讨论】:

      【解决方案2】:

      您应该考虑使用 Sass 媒体查询,而不是使用 jQuery 来更改页面的样式。

      http://thesassway.com/intermediate/responsive-web-design-in-sass-using-media-queries-in-sass-32

      http://thesassway.com/intermediate/responsive-web-design-part-2

      更简单,不依赖js事件和代码操作。

      希望对你有帮助, 干杯。

      【讨论】:

        猜你喜欢
        • 2013-04-09
        • 2020-01-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-06-17
        • 1970-01-01
        • 2020-05-10
        • 1970-01-01
        相关资源
        最近更新 更多