2013-02-27 169 views
0

我已經創建滑動面板使用jQuery的移動,我想減少面板的寬度大小,我不知道如何做到這一點?!我用Google搜索了很多,但沒有找到正確的一個
我的代碼:在jQuery的移動滑動面板[數據角色=「面板」]

<div data-role="page" id="home" class="jqm-demos ui-responsive-panel" data-title="Home"> 
    <div data-role="panel" id="myPanel" data-theme="a" data-dismissible="true" class="ui-responsive-panel"> 
     <div id="menu"> 
      <ul> 
       <li class="active"><a href="#home" class="contentLink">Home </a></li> 
       <li><a href="#home" class="contentLink">My profile </a></li> 
       <li><a href="#home" class="contentLink">My Score </a></li> 
       <li><a href="#home" class="contentLink">Ask Questions </a></li> 
      </ul> 
     </div> 
    </div> 
    <div data-role="header" data-position="fixed"> 
     <h1>Home</h1> 
     <a href="#myPanel" data-role="button" data-display="reveal" data-position="right" data-icon="gear" data-reveal="reveal" data-dismissible="true">Menu</a> 
    </div> 

回答

0

用CSS嘗試:

.ui-responsive-panel{ 
    width: 200px; /* <---------your choice of px*/ 
} 

使用jQuery:

$(function(){ 
    $('#myPanel').css('width','200px'); 
}); 

或本:

$('#myPanel').width(200); 

您的評論:i want decrease the width size of the panel嘗試以下之一:

$(function(){ 
    $('#myPanel').css('width',$(this).width()-200+'px'); 
}); 
+0

但來到像這樣... https://docs.google.com/file/d/0B7s0BYiHsMBtUWlGcG1jZWY0cm8/edit?usp=sharing – Sriram 2013-02-27 11:18:31

+0

哪一個你做? – Jai 2013-02-27 11:27:09

+0

css&jquery [top 2] – Sriram 2013-02-27 11:29:54