我正在创建一个小型的在线IDE(受Cloud9 IDE启发)作为一个业余项目,但是我在布局上苦苦挣扎。我开始使用Twitter Bootstrap,但是不可能有可停靠的面板(侧栏,页脚等)。因此,我正在寻找一个基于Javascript的框架,或者甚至一个现代CSS框架,该框架允许我使用可停靠面板等进行布局。与此类似:
http://i.stack.imgur.com/u5tS6.png
我能够找到此jQuery插件:http : //layout.jquery-dev.net/index.cfm但它似乎已过时且非常肿。那里有类似的东西吗?
UPDATE: I'm not looking for an ExtJS alternative. I don't need widgets, datagrids or anything. I just need a flexible layout framework, which allows me to dock those layouts.
This is typically achieved through position: absolute
. Say you have a container with a panel docked on the side and a panel in the middle:
<div class="container">
<div class="side-panel">
<!-- ... -->
</div>
<div class="middle-panel">
<1-- ... -->
</div>
</div>
If side-panel
was to be 200 pixels wide, this would suffice:
.side-panel {
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 200px;
}
.middle-panel {
position: absolute;
top: 0;
bottom: 0;
left: 200px;
right: 0;
}
top
, bottom
, left
, and right
specify the distance between that edge of the element and its container.1 It turns out that you can nest these, too. Put this together and you can have a rather sophisticated fixed panel-based layout.
当然,您可能希望动态调整面板。为此,您需要编写一些JavaScript来style
动态设置。要重新排列页面的整个布局,您需要超越设置style
s并在DOM中移动元素。
1实际上是最近的非static
定位元素。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句