我认为解决这个问题的最佳方法是使用on-resize事件,并根据固定限制动态计算元素的宽度和高度。我做了一个小的概念示范,使用jQuery和jQueryUI(用于调整大小)。这个概念的核心是:
$("#a").resizable({
//listen to the event of resize
resize: function() {
//calculate and set the new widths and heights of the elements
$("#b").width(500 - $(this).width());
...
}
});
这是代码链接: http://jsfiddle.net/cxfghe0a/25/
以下是所使用元素的参考: