我有一个可拖动的div,可调整大小的东西手柄,包含在一个更大的div中,并与其他div组合。
这一切都有效,除了当我拖动div并让它捕捉到另一个div时,当可调整大小的时候引发了可拖动的div消失。
如果我将div拖动到其他一个捕捉div,然后将其返回到原始div我可以调整大小并且div不会消失。
我有一个JS Bin: http : //jsbin.com/xexutikeja/edit?html,css, js, output
I have a draggable div with resizable east and west handles that is contained in a larger div and snaps to other divs.
This all works except for when I drag the div and let it snap to another div, when the resizable is evoked the draggable div dissapears.
If I drag the div to one of the other snapping divs then return it to the origination div I can resize and the div does not disappear.
I have a JS Bin for this: http://jsbin.com/xexutikeja/edit?html,css,js,output
最满意答案
resizable中的containment与draggable containment不匹配,因此它尝试将包含设置为原始parent ,但该元素位于另一个div上。 只需更改您的可调整大小:
$('#cat').resizable({ handles: "e, w", containment: ".bigCat" })Your containment in resizable doesn't match the one in your draggable, so it tries to set containment to original parent, but the element is over another div. Simply change your resizable for:
$('#cat').resizable({ handles: "e, w", containment: ".bigCat" })JQuery:Draggable div在移动到新div时会消失,而Resizable会被唤起(JQuery: Draggable div disappears when moved to new div and Resizable evoked)我有一个可拖动的div,可调整大小的东西手柄,包含在一个更大的div中,并与其他div组合。
这一切都有效,除了当我拖动div并让它捕捉到另一个div时,当可调整大小的时候引发了可拖动的div消失。
如果我将div拖动到其他一个捕捉div,然后将其返回到原始div我可以调整大小并且div不会消失。
我有一个JS Bin: http : //jsbin.com/xexutikeja/edit?html,css, js, output
I have a draggable div with resizable east and west handles that is contained in a larger div and snaps to other divs.
This all works except for when I drag the div and let it snap to another div, when the resizable is evoked the draggable div dissapears.
If I drag the div to one of the other snapping divs then return it to the origination div I can resize and the div does not disappear.
I have a JS Bin for this: http://jsbin.com/xexutikeja/edit?html,css,js,output
最满意答案
resizable中的containment与draggable containment不匹配,因此它尝试将包含设置为原始parent ,但该元素位于另一个div上。 只需更改您的可调整大小:
$('#cat').resizable({ handles: "e, w", containment: ".bigCat" })Your containment in resizable doesn't match the one in your draggable, so it tries to set containment to original parent, but the element is over another div. Simply change your resizable for:
$('#cat').resizable({ handles: "e, w", containment: ".bigCat" })
发布评论