Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/406.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript JQuery Mobile中的干刷导航_Javascript_Jquery_Jquery Mobile - Fatal编程技术网

Javascript JQuery Mobile中的干刷导航

Javascript JQuery Mobile中的干刷导航,javascript,jquery,jquery-mobile,Javascript,Jquery,Jquery Mobile,我在一个用JQuery Mobile开发的项目上放了一些JQuery滑动导航。我可以让它工作没有担心,但它不是一个干涸的实施,我知道我会有问题在未来更新它。我拥有的是一系列HTML页面,可以滑动导航到同一文件夹中的其他HTML页面。下面是一个HTML代码示例: <div id="point2" class="tpb" data-role="page" data-title="Baby Section - Talking Point 2"> <header data-role

我在一个用JQuery Mobile开发的项目上放了一些JQuery滑动导航。我可以让它工作没有担心,但它不是一个干涸的实施,我知道我会有问题在未来更新它。我拥有的是一系列HTML页面,可以滑动导航到同一文件夹中的其他HTML页面。下面是一个HTML代码示例:

<div id="point2" class="tpb" data-role="page" data-title="Baby Section - Talking Point 2">
  <header data-role="header" data-theme="f" data-position="fixed">
      <a href="#" data-rel="back" data-theme="h" data-icon="arrow-l" data-direction="reverse">Back</a>
      <a href="../activities.html" data-theme="h" data-icon="baby">Activities</a>
      <h1>0-12 Months</h1>
  </header>
  <div data-role="content" class="content" data-theme="a">
   <h1>Mother&rsquo;s Voice</h1>
   <p>Babies learn to recognise their mother&rsquo;s voice in utero. By birth your baby has a preference for your voice over other sounds. Babies also begin to learn the difference between sounds not long after birth.</p>
<p>Talk to your baby often and from birth. Use their name, talk about whatever you are doing and repeat words many times. Babies need to hear words lots of times before they understand and use them.</p>
    <p><img src="../../img/baby/Baby-TP2-Mothers-Voice.jpg" class="insert" /></p>
  </div>
<script type="text/javascript">
$("#point2").on('swipeleft', function (event, ui) {
   if(event.handled !== true){
    $.mobile.changePage('point3.html', {transition: "slide", reverse: false}, true, true);
       event.handled = true;
   }
    return false; 
});
$("#point2").on('swiperight', function (event, ui) {
   if(event.handled !== true){
    $.mobile.changePage('point1.html', {transition: "slide", reverse: true}, true, true);
       event.handled = true;
   }
    return false; 
}); 
</script>
</div>
现在,我试图按照JQuery移动文档以枯燥的方式进行操作,而这些文档对我来说毫无意义。似乎示例所做的只是交换具有不同背景图像的div


如果所有页面都在一个HTML文件中,并且全部加载到DOM单页面应用程序中,我相信我可以干法工作,但我使用的是单独的文件吗?我只是想知道我是否可以设置一个数组来拾取文件夹中的连续页面并保持一定的顺序?我的JS技能不是很好,所以我正在寻找一个工作示例,以便我能够理解它的实现。请让我知道,如果你有任何好的实现这一点。我想干

干在单页模型可能无法实现,因为您需要在每个html页面中加载所有库和-可能-代码。假设用户绕过主页page1直接转到另一个页面pageX,如果主库没有加载,页面将失败。感谢Omar,这就是我的想法。以前,当我将它们放在一个单页模型中时,代码非常枯燥,但是在代码审查之后,我被告知要将它们分开,因为这会使DOM模型膨胀。然后他们叫我把它弄干!厚脸皮的羊肉。。。