2013-02-27 3 views
0

jquery 모바일을 사용하여 슬라이딩 패널을 만들었습니다. 패널의 너비 크기를 줄이려고합니다. 어떻게해야할지 모르십니까?! 나는 많이 봤하지만 올바른
내 코드를 찾을 didnt는 :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를보십시오 : jQuery로

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

:

$(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

+0

하는 일을 그랬어? – Jai

+0

css & jquery [위로 2] – Sriram

관련 문제