使用 Jquery Mobile 的页面屏幕方向问题

发布于 2024-12-19 20:07:21 字数 192 浏览 0 评论 0原文

我刚刚开始开发移动网络应用程序,我正在使用 Jquery Mobile 制作 HTML5 页面。我在 iPhone 和 iPhone 上测试了我的页面iPad。问题是,当我从纵向模式更改为横向模式,然后从横向模式更改为纵向模式时,我的页面仍然处于放大状态。 在 n 次方向变化后,无论方向如何,如何恢复到最佳缩放级别。我在元标记中使用了设备宽度、设备高度、设备密度

I have just started working on mobile web apps, i am making HTML5 pages using Jquery Mobile. I tested my pages on iPhone & iPad. The issue is that when i change from portrait to landscape and then from landscape to portrait mode, my pages remain zoomed in.
How can i restore to the optimum zoom level whatever the orientation maybe, after n number of orientation changes. I have used device-width, device-height, device-density in my meta-tag

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

握住我的手 2024-12-26 20:07:21

不确定你从哪里得到的,但这是我正在使用的视口元标记,我很确定它会解决你的问题:

<meta name="viewport" content="minimum-scale=1.0, width=device-width, maximum-scale=1.0, user-scalable=no"  />

更新:

你将需要 2 个不同的视口,每个方向模式一个。
查看一下以了解如何即时更改它们。

希望这有帮助

Not sure from where you got yours, but this is the viewport meta tag that I am using and am pretty sure it will solve your problem:

<meta name="viewport" content="minimum-scale=1.0, width=device-width, maximum-scale=1.0, user-scalable=no"  />

UPDATE:

you'll need 2 different viewports, one per orientation mode.
check this out to see how to change them on the fly.

Hope this helps

浅沫记忆 2024-12-26 20:07:21

我有同样的问题。

这篇文章回答了你的问题:
JQuery 移动当旋转到横向时,Beta 1 不会调整 iPhone 上的屏幕大小
虽然我不使用 Beta,而是使用 1.1.0 版本,但解决方案已应用。

简而言之,您的视口元应该如下所示。

I have the same problem.

This post answers your question:
JQuery Mobile Beta 1 is not resizing the screen on iphone when rotated to landscape
Although I do not use Beta but version 1.1.0, the solution applied.

In short, your Viewport Meta should look like this.

<meta name="viewport" content="initial-scale=1, maximum-scale=1">

ゞ记忆︶ㄣ 2024-12-26 20:07:21
This may be helpful for you, mantain two stylesheets in landscape and portrait mode 

 window.onorientationchange=detectIPadOrientation;

function detectIPadOrientation()
{
    //check for the mode and apply the appropriate style sheet,window.onorientationchange is the method will be called whenever the orientation changes

}
This may be helpful for you, mantain two stylesheets in landscape and portrait mode 

 window.onorientationchange=detectIPadOrientation;

function detectIPadOrientation()
{
    //check for the mode and apply the appropriate style sheet,window.onorientationchange is the method will be called whenever the orientation changes

}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文