当使用 JQuery UI 可调整大小调整其容器大小时,想要自动调整 jQuery UI.Layout 的 div 宽度和高度!
我将使用 jQuery UI.Layout 插件 和 JQuery UI 可调整大小插件。
我的代码结构如下:
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 ressized插件和jquery uidraggable插件。
代码附加布局 Ui 插件:
$(document).ready(function () {
$('#container').layout();
});
但是当我调整 div id="container" 的大小时,布局似乎被破坏了。内部内容也保留原始内容和高度。所以,我需要一种方法,使内部的布局可以在我调整它们的容器大小时自动调整大小。
非常感谢!!
I am going to using jQuery UI.Layout Plug-in with JQuery UI resizable plugin.
the container layout example of JQuery UI layout plugin:
My code struct like this:
html code:
<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>
and the div id="container" will be attached with jquery ui resizable plugin and jquery ui draggable plugin.
the code attach layout Ui plugin:
$(document).ready(function () {
$('#container').layout();
});
But it seems when I resize the div id="container",the layout was broken.the inner contents also preserve original with and height.So, I need a way to make the layout of inner could auto resize when I resize the container of them.
Thank you very much!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道这个布局插件,但它看起来很有趣......谢谢!
查看布局的文档,有一个名为 resizeAll() 的方法“调整整个布局的大小以适合其容器”。我不太明白他们给出的例子,但我想你可能想使用它。否则,您可以从可调整大小的停止事件中调用此函数:
I didn't know this layout plugin, but it seems pretty interesting... Thanks!
Check out the documentation of the layout, there's is a method called resizeAll() "Resizes the entire layout to fit its container". I don't really get the example they give, but I guess you might want to use it. Otherwise you can call this function from the stop event of the resizable: