它不漂亮,但它有效。
$( "#this" ).resizable({
handles: "e",
resize: function(event, ui) {
$( "#that" ).width($(this).width());
$( "#that" ).height($(this).height());
},
stop: function(event, ui) {
$( "#that" ).width($(this).width());
$( "#that" ).height($(this).height());
},
grid: 100
});
$( "#that" ).resizable({
handles: "e",
resize: function(event, ui) {
$( "#this" ).width($(this).width());
$( "#this" ).height($(this).height());
},
stop: function(event, ui) {
$( "#this" ).width($(this).width());
$( "#this" ).height($(this).height());
},
grid: 100
});
你的 JS 小提琴的工作版本
http://jsfiddle.net/Robodude/CbYtT/3/