简体   繁体   English

jQuery Mobile加载错误

[英]jQuery Mobile Loading Error

I am trying to make a mobile application using jQuery. 我正在尝试使用jQuery制作移动应用程序。 I am using to make a swipe panel and i have a source for it. 我用来做一个滑动面板,我有它的来源。 The sources are .html .css and .js the html and css seem to work but the .js does not. 来源是.html .css和.js,而html和css似乎有效,但.js无效。 Any answers? 有什么答案吗?

Its suppose to look like this this 它应该看起来像这样

Also its on my local web server. 也在我的本地Web服务器上。

Source Code: 源代码:

.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");
      }
    }
  });
});

You need to load your JS files in this order: 您需要按以下顺序加载JS文件:

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM