2013-03-05 78 views
0

我爲網站使用jQuery EasyUI佈局類(http://www.jeasyui.com/documentation/layout.php)。在佈局div中,可以放置區域(北,南,西,東和中心)。jQuery EasyUI:相對面板/佈局尺寸(百分比)

我想讓北面和南面的面板相對於容器的尺寸而不是給它們絕對的px值。所以我想從這個

<div id="cc" class="easyui-layout" style="width:200px;height:400px;"> 
    <div data-options="region:'north',title:'North',split:true" style="height:100px;"></div> 
    <div data-options="region:'south',title:'South',split:true" style="height:100px;"></div> 
    <div data-options="region:'center',title:'center'"></div> 
</div> 

移動到這個

<div id="cc" class="easyui-layout" style="width:200px;height:400px;"> 
    <div data-options="region:'north',title:'North',split:true" style="height:25%;"></div> 
    <div data-options="region:'south',title:'South',split:true" style="height:25%;"></div> 
    <div data-options="region:'center',title:'center'"></div> 
</div> 

雖然第一個版本只是罰款(見本fiddle),二不(見here)。有沒有人有一個想法,爲什麼不,即如何使面板相對於他們的維度?謝謝!

回答

1

試試這個,

<div id="cc" class="easyui-layout" style="width:200px;height:400px;"> 
    <div data-options="region:'north',title:'North',split:true" class="north"></div> 
    <div data-options="region:'south',title:'South',split:true" class="south"></div> 
    <div data-options="region:'center',title:'center'"></div> 
</div> 

.north 
{ 
    height:25%; 
} 
.south 
{ 
    height:25%; 
}