如何动态设置每个拖动元素的可排序拖动区域的顶部位置
JS
$( "#editorDesignView" ).droppable({
accept: '#textTemplate',
drop: function( event, ui ) {
var html = '<div id="" style="background: #eee; width: 80%; margin: 10px auto; padding: 10px;"><div class="option_toolbar"><div class="draggable-area dr-toolbar">Drag</div></div><p contenteditable="true" style="padding: 5px;">Add your text here.</p></div>';
$(html).appendTo(this).hide().slideDown();
}
});
$('#editorDesignView').sortable({
handle: ".draggable-area",
});
CSS
#editorDesignView:hover .option_toolbar {
display: block;
z-index: 10;
position: fixed;
left: 68%;
top: 1;
}
有关详细信息,请访问我的jsfiddle