我试图创建一个webapp的整体布局。该应用程序是全屏幕,并有一个固定的标题和三列/窗格。中心窗格包含两行:使用jQuery UI的可调整大小的窗格的完整页面布局
的窗格应该通过拖动窗格用鼠标边缘可调整大小的(参见上文中的图像箭头)。
如果内容溢出,即没有全局浏览器窗口滚动条,单个窗格应具有垂直滚动条。
使用jQuery和jQuery UI可调整大小,我创建了this (partly working) JSFiddle。
HTML:
<div class="header">
Fixed header
</div>
<div class="wrapper">
<div class="inner-wrapper">
<div class="left pane">Left</div>
<div class="center pane">
<div class="inner">
<div class="top">Center top</div>
<div class="bottom">Center bottom</div>
</div>
</div>
<div class="right pane">Right</div>
</div>
</div>
CSS:
html, body {
height: 100%;
}
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 20px;
background-color: moccasin;
}
.wrapper {
position:absolute;
top: 21px;
right: 0;
bottom: 0;
left: 0;
background-color: fuchsia;
}
.inner-wrapper,
.center.pane .inner {
display: table;
width: 100%;
height: 100%;
}
.pane {
display: table-cell;
}
.left.pane {
background-color: olivedrab;
}
.center.pane {
background-color: lightblue;
}
.center.pane .inner .top,
.center.pane .inner .bottom{
display: table-row;
}
.center.pane .inner .top {
background-color: lightcoral;
}
.center.pane .inner .bottom {
background-color: orange;
height: 100%;
width: 100%;
}
.right.pane {
background-color: #999;
}
的JavaScript:
$(function() {
$(".left.pane").resizable({
handles: "e, w"
});
$(".right.pane").resizable({
handles: "e, w"
});
$(".center.pane .inner .bottom").resizable({
handles: "n, s"
});
});
它有几个问题,包括:
- 当调整左,右也是大小(它不应该)
- 当左大小的调整对整个宽度,中心内容是对下隐藏
- 当调整右包装(紫红色颜色)是部分可见
- 底部中心通过中心顶部的顶部调整,而不是通过它自己的顶级
我知道了jQuery插件布局的,但就我所看到的,它不提供相当的布局我在之后。另外,我想尽可能保持简单。
此外,我已经尝试Methvins分配器插件,但无法让它工作。
我的问题:
为如何从jQuery UI的图像可调整的创建布局和我有什么在JSFiddle有什么建议?
这实际上是我们最终使用的。 – agibsen
hahahah好的。请点击“勾号”接受答案,如果你认为这是最正确的:-) –
检查UI布局的代码,它是pooor文档,加上过于复杂的代码,布局库不需要如此复杂,很多事情可以在CSS而不是使用javascript –