问题描述
使用 jQueryMobile,我在标记中包含了 data-role="footer" data-position="fixed"
,但仍有两个错误:
Using jQueryMobile, I've included data-role="footer" data-position="fixed"
in the markup, but two bugs persist:
- 页脚在空点击事件上切换.
- 页脚不是固定的,它隐藏了一些页面内容.
我正在使用 iPhone 3g 进行测试.有什么想法吗?
I'm testing with iPhone 3g. Any ideas?
提前致谢.
UPDATE:好像是点击事件修改了当前页面的页脚,把ui-fixed-overlay
改成了ui-fixed-inline
,当然是样式 display:none
以防止其他页面的页脚出现.
UPDATE: It seems that the click event modifies the current page's footer, and changes ui-fixed-overlay
to ui-fixed-inline
, which of course is styled display:none
to prevent the other pages' footers from appearing.
如何防止这种修改?
推荐答案
如果使用 1.1 或更高版本,请将 data-tap-toggle="false"
添加到您的标题和页脚,如此处记录.
If using 1.1 or later, add data-tap-toggle="false"
to your header and footer, as documented here.
如果您使用的是 jQuery Mobile 1.1 之前的版本,请在加载 jQuery Mobile 之前放置以下内容:
If you're using a version of jQuery Mobile prior to 1.1, place the following before loading jQuery Mobile:
$(document).bind("mobileinit", function(){
$.mobile.touchOverflowEnabled = true;
}); // remove
这篇关于如何修复 jQuery Mobile 的固定页脚?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!