2014-10-30 58 views
0

目前我正在使用侧面板,只需点击一个按钮,它就可以看到,因为它必须始终显示在页面上。可能吗。并且还显示侧面板时,页面的某些部分不可见,因为它应该通过全部显示调整到屏幕。如何在jquery mobile的页面上使侧面板静态

有人可以帮助我,谢谢。

<div data-role="page" id="pageone" class="type-interior"> 
    <div data-role="content" style="padding:0em;"> 

     <a href="#nav-panel" data-icon="bars" data-iconpos="notext">Menu</a> 

     <div class="content-primary"> 
//here page content was there 
</div> 
<div data-role="panel" data-position="left" data-position-fixed="true" data-display="reveal" id="nav-panel" data-theme="a"> 
</div> 
</div> 
+0

如果您包含您一直在处理的代码,您会发现获得更多帮助。 – 2014-10-30 06:41:43

+0

我编辑了这个问题 – 2014-10-30 07:05:15

回答

0

根据jQuery的移动文档:

的面板必须是同级一个jQuery移动页内的标题,内容和页脚元素。

此外,面板默认是隐藏的,但你可以在pagecreate事件打开:

  • HTML:

    <div data-role="page" id="pageone" class="type-interior"> 
        <div class="ui-content" style="padding:0em;"> 
         <a href="#nav-panel" data-icon="bars" data-iconpos="notext">Menu</a> 
    
         <div class="content-primary"> 
          //here page content was there 
         </div> 
        </div> 
    
        <div data-role="panel" data-position="left" data-dismissible="false" id="nav-panel" data-theme="a"> 
         <p>Test</p> 
        </div> 
    </div> 
    
  • JS:

    $(document).on('pagecreate', function() { 
        $("#nav-panel").panel("open"); 
    }); 
    

这里是demo