如何修复jQuery Mobile的固定页脚?

Tom*_*ash 18 javascript iphone mobile jquery footer

使用jQueryMobile,我已经包含data-role="footer" data-position="fixed"在标记中,但仍存在两个错误:

  • 页脚在空单击事件上切换.
  • 页脚未修复,并隐藏了部分页面内容.

我正在测试iPhone 3g.有任何想法吗?

提前致谢.

更新:似乎click事件修改了当前页面的页脚,并更改ui-fixed-overlayui-fixed-inline,当然这样做的样式是display:none为了防止其他页面的页脚出现.

我该如何防止这种修改?

Roi*_*Roi 25

如果使用1.1或更高版本,请添加data-tap-toggle="false"到页眉和页脚,如此处所述.

如果您使用1.1之前的jQuery Mobile版本,请在加载jQuery Mobile之前放置以下内容:

$(document).bind("mobileinit", function(){
  $.mobile.touchOverflowEnabled = true;
}); // remove
Run Code Online (Sandbox Code Playgroud)

  • 截至今天,当我检查touchOverflowEnabled时,不再支持.您可以使用上面的文档链接查看官方说明. (3认同)

Sim*_*ane 14

这在jQueryMobile 1.1 rc1中得到修复.看到这里.

在页脚上使用data-tap-toggle ="false".