位置:Windows Phone 7 中固定

发布于 2025-01-05 21:06:53 字数 231 浏览 0 评论 0原文

我正在尝试创建 PhoneGap Windows Phone 7 应用程序。为了模仿应始终在横向屏幕左侧可见的应用程序栏,我想放置一个 CSS 为 position:fixed

代码>.然而这不起作用,因为 WP7 上的 IE 似乎不支持它。

有谁知道如何在没有 position:fixed 可用的情况下显示这样的应用程序栏?

提前致谢

I'm trying to create a PhoneGap Windows Phone 7 application. In order to imitate an Application bar that should always be visible at the left side of the screen in landscape orientation, I wanted to place a <div> with CSS as position:fixed. This does not work, however, because the IE on WP7 seems not to support it.

Does anyone have an idea how I can display such an Application bar without having position:fixed available?

Thanks in advance

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

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

发布评论

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

评论(2

迎风吟唱 2025-01-12 21:06:53

我也一直纠结这个问题。看起来确实不可能创建一个固定元素并在每次滚动后定位元素,看起来更糟糕(尝试手机上的 jquery mobile 在线示例,他们就是这样做的)。

我通过为我的非固定内容使用 div 容器来“解决”这个问题,样式为“overflow:scroll”并且大小固定。这对我有用。但在此容器中滚动看起来不像本机滚动。

希望有帮助

I was also hanging on this problem. It really seems not to be possible to create a fixed element and to position elements after every scroll looks even worse (try the jquery mobile online examples on your phone they do it this way).

I "solved" the problem by using a div container for my non fixed content with style="overflow: scroll" and fixed size. This worked for me. But scrolling in this container doesn't look like native scrolling.

Hope that helps

如梦初醒的夏天 2025-01-12 21:06:53

我已经成功解决了我的 Win 手机 8 (Lumia 930) 上的问题。

我有一个模态窗口,在移动设备上打开时应保留在视点中并在内部滚动。 Android 和 iphone 工作正常,位置固定,但 win 手机则不行。

我的解决方案是当模态处于活动状态时将活动类放在 html 上,并将其添加到 css 中:

html.modal_active{
  overflow-y: hidden;-webkit-overflow-scrolling:touch; position: absolute; height: 100%; width: 100%;
  body{overflow-y: hidden;-webkit-overflow-scrolling:touch; position: absolute; height: 100%; width: 100%;}
}

打开模态时将 html 和 body 定位到绝对位置解决了问题。希望有帮助!

I've managed to solve the problem on my Win phone 8 (Lumia 930).

I have a modal window and when opened on mobile should stay in view point and scroll inside. Android and iphone worked fine with position fixed but win phone didn't.

My solution was to put active class on html when the modal is active and add this to css:

html.modal_active{
  overflow-y: hidden;-webkit-overflow-scrolling:touch; position: absolute; height: 100%; width: 100%;
  body{overflow-y: hidden;-webkit-overflow-scrolling:touch; position: absolute; height: 100%; width: 100%;}
}

This positioning html and body to absolute when modal is opened solved the problem. Hope it helped!

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