我正在尝试使用jQuery将“Draggable”变成DIV(id = sortable),但它不能正常工作“Resize”。
- Resizable在DIV(id = sortable)
中无法正常工作 醇>
有谁知道我做错了什么?
脚本和 HTML
$(function() {
$("#sortable").sortable({
revert: true
});
$("#draggable").draggable({
connectToSortable: "#sortable",
helper: "clone",
revert: "invalid"
});
$('.resizemove').resizable();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div>
<div id="draggable" class="ui-state-highlight ui-state-default resizemove DivStyle" style="width:100px; height:100px; display:block; background: lightyellow;">Drag me down</div><br>
</div>
<div id="sortable" class="main-wrap" style="border:5px solid rgb(221, 221, 221);padding: 5px; clear: both;">
<div class="ui-state-default resizemove DivStyle" style="width:100px; height:100px; display:block; background: lightbluered;">One</div>
<div class="ui-state-default resizemove DivStyle" style="width:100px; height:100px; display:block; background: lightpink;">Two</div>
<div class="ui-state-default resizemove DivStyle" style="width:100px; height:100px; display:block; background: lightgray;">Three</div>
<div class="ui-state-default resizemove DivStyle" style="width:100px; height:100px; display:block; background: lightseagreen;">Four</div>
<div style="clear:both"></div>
</div>
以下是JsFiddle
答案 0 :(得分:0)
我会调整你的可拖动手柄。例如:
$("#draggable").draggable({
connectToSortable: "#sortable",
handle: $(this).not(".ui-resizable-handle"),
helper: "clone",
revert: "invalid"
});