2013-08-07 64 views
1

我正在与Jquery Mobile第一次设计一个移动Web应用程序。该应用程序有一个页面,它具有放置在固定位置的页眉和导航栏。点击导航栏上的选项卡,页面将加载到最初留空的div内导航栏下方的同一页面上。似乎通过ajax在同一页面上调用新页面使得Jquery移动效果不起作用。数据主题,数据角色,范围和其他数据属性均不起作用。 我想实现一个页面“日志”滑块,但只显示了一个值的文本框在里面Jquery Mobile滑块不工作JQM 1.3.2和Jquery 1.10.2

<div style="float:left" data-role="fieldcontain"> 
<label for="slider-fill">Input slider:</label> 
<input type="range" name="slider-fill" id="slider-fill" min="0" max="100" data-highlight="true" /> 
</div> 

我使用jQuery Mobile的1.3.2和jQuery 1.10.2!

这是该页面的html代码。 一旦我连接到数据库,你会看到很多重复代码,因为它没有连接到完整的数据库,所以它不会混乱。

<body> 
<link href="css/description.css" type="text/css" rel="stylesheet" /> 
<link href="css/style.css" rel="stylesheet" type="text/css"> 
<link href="css/style (2).css" type="text/css" rel="stylesheet" /> 
<script src="js/custom.js"></script> 
<script src="js/jquery.raty.js"></script> 

<script> 
$(document).ready(function(e){ 
    $('#star').raty({ 
    cancel : true, 
    cancelOff: 'images/cancel-off-big.png', 
    cancelOn : 'images/cancel-on-big.png', 
    half  : true, 
    size  : 30, 
    starHalf : 'images/star-half-big.png', 
    starOff : 'images/star-off-big.png', 
    starOn : 'images/star-on-big.png' 
}); 

    $('#add_journal').click(function(e) { 
     $('#add_journal').hide(); 
     $('#journal_content').show(); 
    }); 
    }); 



</script> 

<style> 
#journal_content 
{ 
    display:none; 
} 

</style> 



<div data-role="content" data-theme="a"> 

    <div style="text-align:center; margin:10px; margin-bottom:10px;"> 
     <a href="#" data-role="button" id="add_journal" style="text-decoration:none; background-color:#67222e; padding:10px; color:#fff;">New Journal Entry</a> 
    </div> 

    <div id="journal_content"> 
     <div class="data"> 
      <h3> My Ratings: </h3> 
      <div id="star"></div> 
     </div> 

     <div class="data"> 
      <div style="float:left"> 
       <h3> Tasting Notes: </h3> 
      </div> 
      <div style="float:right; padding-top:20px;"> 
       <a href="tasting_notes.php"><img src="images/plus.fw.png" /></a> 
      </div> 
      <div style="clear:both" id="notes"> 

      </div> 
     </div> 

     <div class="data"> 
      <h3> Appearance </h3> 
      <hr> 
      <div class="data_inside"> 
       <div style="float:left"> 
        <h4> Descriptor words: </h4> 
       </div> 
       <div style="float:right; padding-top:20px;"> 
        <a href="tasting_notes.php"><img src="images/plus.fw.png" /></a> 
       </div> 
       <div style="clear:both" id="notes"> 

       </div> 
      </div> 
      <hr> 
      <div class="data_inside"> 
       <div style="float:left"> 
        <h4> Color Match: </h4> 
       </div> 
       <div style="float:right; padding-top:20px;"> 
        <a href="tasting_notes.php"><img src="images/plus.fw.png" /></a> 
       </div> 
       <div style="clear:both" id="notes"> 

       </div> 
      </div> 

     </div> 



     <div class="data"> 
      <h3> Aroma </h3> 
      <hr> 

      <div class="data_inside"> 
       <div style="float:left"> 
        <h4> Aroma Wheel: </h4> 
       </div> 
       <div style="float:right; padding-top:20px;"> 
        <a href="tasting_notes.php"><img src="images/plus.fw.png" /></a> 
       </div> 
       <div style="clear:both" id="notes"> 

       </div> 
      </div> 
      <hr> 
      <div class="data_inside"> 
       <div style="float:left"> 
        <h4> Descriptor Words: </h4> 
       </div> 
       <div style="float:right; padding-top:20px;"> 
        <a href="tasting_notes.php"><img src="images/plus.fw.png" /></a> 
       </div> 
       <div style="clear:both" id="notes"> 

       </div> 
      </div> 

     </div> 

     <div class="data"> 
      <h3> Taste: </h3> 
      <hr> 

      <div class="data_inside"> 
       <div style="float:left"> 
        <h4> Tasting Wheel: </h4> 
       </div> 
       <div style="float:right; padding-top:20px;"> 
        <a href="tasting_notes.php"><img src="images/plus.fw.png" /></a> 
       </div> 
       <div style="clear:both" id="notes"> 

       </div> 
      </div> 
      <hr> 
      <div class="data_inside"> 
       <div style="float:left"> 
        <h4> Descriptor Words: </h4> 
       </div> 
       <div style="float:right; padding-top:20px;"> 
        <a href="tasting_notes.php"><img src="images/plus.fw.png" /></a> 
       </div> 
       <div style="clear:both" id="notes"> 

       </div> 
      </div> 

     </div> 


      <div class="data"> 
      <h3> Body/Structure: </h3> 
      <hr> 

      <div class="data_inside"> 
       <div style="float:left"> 
        <h4> Descriptor Words: </h4> 
       </div> 
       <div style="float:right; padding-top:20px;"> 
        <a href="tasting_notes.php"><img src="images/plus.fw.png" /></a> 
       </div> 
       <div style="clear:both" id="notes"> 

       </div> 
      </div> 
      <hr> 
      <div class="data_inside"> 
       <div style="float:left" data-role="fieldcontain"> 
        <h4> Tannis: </h4> 
        <label for="slider-fill">Input slider:</label> 
        <input type="range" name="slider-fill" id="slider-fill" min="0" max="100" data-highlight="true" /> 
       </div> 

       <div style="clear:both" id="notes"> 

       </div> 
      </div> 

     </div> 








    </div> 





</div> 



</body> 
+0

复制/粘贴代码到我的项目模板,它也有页眉/页脚和它工作得很好原样是。我正在使用jquery 1.9.1和jqm 1.3.1。你能发布你的html页面的全部内容吗? – Drew

+0

更新了我的代码,以便将jquery 1.10.2和jqm 1.3.2与您的操作相匹配并且仍然有效。 – Drew

+0

@德鲁:你能告诉我你的页面如何运作?如在,你怎么在div的内部调用你的页面?我调用的页面只有内容部分通过ajax调用页面不会加载头部分。 – Sidharth

回答