jQuery Mobile - 灰色死角(图片)

发布于 2024-12-25 16:03:15 字数 277 浏览 1 评论 0原文

Gray dead space

链接到我的应用程序:http://gizeto.com/app_orange/index.html

我不明白为什么在 orientationchange 上会发生这种情况。有人认识这个吗?

Gray dead space

Link to my app: http://gizeto.com/app_orange/index.html

I don't understand why this occurs on orientationchange. Does anybody recognize this?

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

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

发布评论

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

评论(1

不…忘初心 2025-01-01 16:03:15

看起来好像您正在使用 iScroll 作为可滚动区域。如果是这种情况,那么每当 resizeorientationchange 事件在 window 对象上触发时,您都需要更新 iScroll 实例:

var myScroll = new iScroll();

//you can change `resize` to `orientationchange` if you only want to support mobile devices
$(window).bind('resize', function () {
    myScroll.refresh();
});

来源:http://cubiq.org/iscroll-4#refreshmethod

这应该保留当文档大小发生变化时,iScroll 区域会显示正确的尺寸。如果 iScroll 容器(在您的情况下是 data-role="content" 元素)仍然没有更新其高度,那么您可能需要手动执行此操作:

$(window).bind('resize', function () {
    $.mobile.activePage.children('[data-role="content"]').height('{HEIGHT HERE}px');
    myScroll.refresh();
});

It appears as though you are using iScroll for your scrollable areas. If this is the case then you will need to update the iScroll instance whenever a resize or orientationchange event fires on the window object:

var myScroll = new iScroll();

//you can change `resize` to `orientationchange` if you only want to support mobile devices
$(window).bind('resize', function () {
    myScroll.refresh();
});

Source: http://cubiq.org/iscroll-4#refreshmethod

This should keep the iScroll area the correct dimensions when the size of the document changes. If the iScroll container (in your case this is the data-role="content" element) still doesn't update it's height then you may need to do that manually:

$(window).bind('resize', function () {
    $.mobile.activePage.children('[data-role="content"]').height('{HEIGHT HERE}px');
    myScroll.refresh();
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文