jQuery Mobile加载错误

jQuery Mobile Loading Error

本文关键字:错误 加载 Mobile jQuery      更新时间:2023-09-26

我正在尝试使用jQuery制作一个移动应用程序。我正在用做一个滑动面板,我有它的来源。来源是.html和.js。html和css似乎可以工作,但.js不行。有答案吗?

这个应该是这样的

它也在我的本地网络服务器上。

源代码:

.js

$(document).on("pageinit", "#demo-page", function () {
  $(document).on("swipeleft swiperight", "#demo-page", function (e) {
// We check if there is no open panel on the page because otherwise
// a swipe to close the left panel would also open the right panel (and v.v.).
// We do this by checking the data that the framework stores on the page element (panel: open).
    if ($.mobile.activePage.jqmData("panel") !== "open") {
      if (e.type === "swipeleft") {
        $("#right-panel").panel("open");
      }
      else if (e.type === "swiperight") {
        $("#left-panel").panel("open");
      }
    }
  });
});

您需要按以下顺序加载JS文件:

<script src="jquery.js"></script>
<script src="custom-scripting.js"></script>
<script src="jquery-mobile.js"></script>

参考:http://jquerymobile.com/demos/1.0/docs/api/globalconfig.html