JQuery Mobile固定工具栏和页脚栏消失了吗?

Sat*_*000 62 jquery-mobile

我正在使用JQuery Mobile版本4.1a并使用:

data-position="fixed"
Run Code Online (Sandbox Code Playgroud)

在页眉和页脚上.

当我滚动内容时,它会消失然后再次出现.

有没有办法让它保持在它的位置而不是每次我滚动页面时都消失?

谢谢

tar*_*war 111

添加data-tap-toggle="false"到元素

要么

将此添加到Javascript

$("[data-role=header]").toolbar({ tapToggle: false });
Run Code Online (Sandbox Code Playgroud)

旧版本的jQuery使用.fixedtoolbar().

jQuery Mobile Docs - 活动


Sat*_*000 15

我找到了解决方案.我已经在我的项目上测试了它,它就像一个魅力.

这是URL:https://github.com/yappo/javascript-jquery.mobile.iscroll

它与AppML使用的JS解决方案相同.

另外,这是一个演示:

http://yappo.github.com/projects/jquery.mobile.iscroll/livedemo.html

ps:它在我的项目上比在实际演示中效果更好,所以值得一试.

享受:o)


i8a*_*bug 4

我在我的项目中遇到了 jquery mobile iscroll 的问题。也许我使用的一些库相互干扰(我正在使用knockout和jquery.templates以及其他一些东西)。对我有用的解决方案是 jquery mobile 滚动视图。可以在此处查看演示。

http://jquerymobile.com/test/experiments/scrollview/

代码在这里

https://github.com/jquery/jquery-mobile/tree/master/experiments/scrollview/

你需要包括

  • jquery.easing.1.3.js
  • jquery.mobile.scrollview.js
  • jquery.mobile.scrollview.css
  • 滚动视图.js

我最近在 jquery 移动项目中使用了它,它在 iphone 3gs 上运行得非常好。在我的旧 Android HTC Magi 上,它运行得不太好,但所有 jquery mobile 都无法在该设备上运行良好。请注意,滚动视图正在实验中,尚未添加到主 jquery mobile 项目中。

如果您没有使用 iScroll 或 jquery mobile 滚动视图,wink 工具包是另一个选择。

http://www.winktoolkit.org/tutorials/119/

就像 iScroll 一样,我无法让它与我的特定项目一起工作,但我认为我并没有真正努力。