In this plunk Jquery UI를 사용하여 스플리터를 구현하려고합니다. 테두리가 움직일 때 크기를 조정해야하는 div가 세 개 있습니다.Jquery UI가 작동하지 않는 스플리터 구현
div의 초기 너비/높이를 계산하고 오프셋을 더하거나 뺍니다. 그러나 이것은 효과가 없습니다. 이 코드의 문제점은 무엇입니까?
HTML
<div style="width:180px;height:200px;float:left;background-color:orange">
<div id="cols" style="width:180px;height:200px"></div>
<div id="div1"></div>
<div id="tabs" style="width:180px;height:200px;background-color:blue;float:left"></div>
</div>
<div id="div2"></div>
<div id="canvas" style="width:200px;height:406px;background-color:red;float:left"></div>
자바 스크립트
var colsH, tabsH, colsW, canvasW;
$("#div1").draggable({
axis: "y",
start: function() {
colsH = $("#cols").height();
tabsH = $("#tabs").height();
},
drag: function(event,ui) {
var shift = ui.offset.top;
$("#cols").height(colsH + shift);
$("#tabs").height(tabsH - shift);
}
});
$("#div2").draggable({
axis: "x",
start: function() {
colsW = $("#cols").width();
canvasW = $("#canvas").width();
},
drag: function(event,ui) {
var shift = ui.offset.left;
$("#cols").width(colsW - shift);
$("#tabs").width(colsW - shift);
$("#canvas").width(colsW + shift);
}
});
* 스플리터 *의 의미를 설명해 주시겠습니까? –
당신의 노력 덕분에 – ps0604