【问题标题】:Jquery mobile : loading spinner not working in JQM 1.4.4 [duplicate]Jquery mobile:加载微调器在JQM 1.4.4中不起作用[重复]
【发布时间】:2014-12-04 15:59:38
【问题描述】:

我正在使用 JQM 1.4.4 并寻找加载消息微调器。 当我使用 JQM 1.2 时,它在 $.mobile.showPageLoadingMsg("a", "No spinner", true); 上运行良好 但同样的方法不适用于 JQM 1.4.4。

我在 Android 上使用 phonegap 3.4 和 JQM 1.4.4。

【问题讨论】:

  • 它不重复,OP 也想隐藏微调器。另一个问题没有反映这一点。 :))
  • @Tasos 很好地阅读了欺骗答案:) $.mobile.showPageLoadingMsg();和 $.mobile.hidePageLoadingMsg();被替换为 $.mobile.loading('show');和 $.mobile.loading('hide');从 jQuery Mobile 1.3.2 开始。
  • @omar。是的,我看到了,但我只是通过问题中的(“没有微调器”,真的)。 :)) 不用担心

标签: android jquery-mobile cordova


【解决方案1】:

这是在 1.4 中展示的新加载器方法。如果要隐藏微调器,则需要在选项中添加 textonly: true。想展示就拿出来

显示加载器

$.mobile.loading( "show", {
  text: "Loading",
  textonly: true,
  textVisible: true,
  theme: "z",
  html: ""
})

演示

http://jsfiddle.net/6y23pua7/

隐藏它$.mobile.loading( "hide" )

【讨论】:

  • 我用它来进行ajax调用..它仍然不工作..
  • 在你的 ajax 调用之前显示它,在你的 ajax 调用完成之后隐藏它。此外,加载器的 z-index 最高 (9999999;) 确保您的页面具有较低的 z-index
  • 它仅在 $(document).on("pageshow","#user_home",function(e){ $.mobile.loading( "show", { text: "Loading", textonly: true, textVisible: true, theme: "z", html: "" }) }) 中工作,而不是在 $(document).on() 之外;
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-11-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多