我正在使用 jquery-ui sortable 在多个可放置区域中拖动一个元素。
我在 div .left 上有多个 dropzone,我需要使用 overflow-y,但是当我将元素从左 div 拖动到右 div 时,该元素位于右 div 后面。
$('.dropzone').sortable({
tolerance: 'pointer',
connectWith: '.dropzone',
placeholder: 'sortable-placeholder draggable',
cancel: ":input, button, .disable-sort-item",
scroll: true,
scrollSensitivity: 10,
scrollSpeed: 10,
appendTo:"body",
zIndex: 99999,
start: function (event, ui) {
},
update: function( event, ui ) {
},
receive: function( event, ui ) {
},
sort: function(event, ui) {
},
stop: function( event, ui ) {
},
beforeStop: function(ev, ui) {
},
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<div class="container">
<div class="left-panel" style="overflow-y:auto; overflow-x:hidden;">
<div class="dropzone" id="d1" style="">
<div class= "draggable ui-sortable-handle">Elem Drag</div>
</div>
<div class="dropzone" id="d2" style=""></div>
<div class="dropzone" id="d3" style=""></div>
<div class="dropzone" id="d4" style=""></div>
</div>
<div class="right-panel" style="overflow:hidden;">
<div class="dropzone" id="d5" style=""></div>
</div>
</div>
对不起,我的英语不好。;)
感谢帮助!