我将可调整大小的DIV初始化为
$('#someDiv').resizable({
handles: "n, e, s, w",
start: function(event, ui) {
// figure out the resize direction here...
}
});
如何知道调整大小操作开始时的方向?
以下是fiddle
答案 0 :(得分:-2)
JS:
$('#someDiv').resizable({
handles: "n, e, s, w",
start: function (event, ui) {
// figure out the resize direction here...
console.log(event);
var srcEl = event.originalEvent.srcElement.className;
console.log(srcEl);
var direction = srcEl.replace('ui-resizable-handle ui-resizable-', '');
console.log(srcEl, direction);
console.log('You are manipulating', direction);
}
});