0

灰色死角

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

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

4

1 回答 1

0

看起来好像您正在将 iScroll 用于可滚动区域。resize如果是这种情况,那么只要在对象上触发ororientationchange事件,您就需要更新 iScroll 实例window

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();
});
于 2012-01-09T21:20:36.310 回答