我将使用带有JQuery UI 可调整大小插件的 jQuery UI.Layout插件。
我的代码结构是这样的:
html代码:
<div id="container">
<div id="paddingWrapper" class="pane ui-layout-center">
<div class="pane ui-layout-center">
Center
<p><a href="http://layout.jquery-dev.net/demos.html"><b>Go to the Demos page</b></a></p>
</div>
<div class="pane ui-layout-north">North</div>
<div class="pane ui-layout-south">South</div>
<div class="pane ui-layout-east">East</div>
<div class="pane ui-layout-west">West</div>
</div>
</div>
并且div id="container"将附加jquery ui resizable plugin和jquery ui draggable plugin。
代码附加布局 Ui 插件:
$(document).ready(function () {
$('#container').layout();
});
但是似乎当我调整div id="container"的大小时,布局被破坏了。内部内容也保留了原始的 with 和 height。所以,我需要一种方法来使内部的布局可以在我调整容器大小时自动调整大小他们。
非常感谢!!