jquery - Jquery Sortable 元素在排序过程中“卡住”
问题描述
我在这里有一种情况,我必须对用户可以对元素进行排序的 dom 元素进行排序。在某些情况下,当我尝试将其放在所需位置进行排序时,它会像下面一样卡住。
下面是我用于排序的代码。
$(sortableSelector).sortable({
placeholder: "sc-highlight",
tolerance: "pointer",
cursorAt: { top: 25, left: 25 },
connectWith: connectWithItem,
handle: ".scw-move",
forcePlaceholderSize: true,
refreshPositions: true,
revert: 450,
items: sortableItems,
//cancel: '.sce-redactor-init',
start: function (event, ui) {
ui.helper.addClass('started-sorting');
ui.item.addClass('started-sorting');
var startedSCPPanel1 = $(ui.helper).closest('div[class^="scp-panel"]');
startedSCPPanel=startedSCPPanel1;
},
change: function () {
console.log('asdf');
},
stop: function (event, ui) {
ui.item.removeClass('started-sorting');
},
beforeStop:function( event, ui ) {
$( this ).attr( "src", "replacement.png" );
}
});
在某些情况下,“stop”和“beforeStop”事件都不会触发。在此先感谢您的帮助。
解决方案
推荐阅读
- javascript - 如何在没有终端命令的情况下运行节点 js 应用程序
- c# - 授权在 ASP Core 中未连接的 signalR 集线器
- reactjs - react/jsx-no-undef 和 no-undef 中未定义列表和未定义结果
- ruby - Vue路由器问题iwth nivagaiotn
- angular - 当在该列上启用复选框选择时,Ag Grid 列变为左对齐
- angular - Master 和 Detail,Angular 发布到 SQL 服务器问题
- clickhouse - ClickHouse异常,代码:1002,主机:xxx,端口:8123;xxx:8123 没有回应
- r - 使用带有范围的 updateSliderInput 更新闪亮的滑块输入
- .net - .net 上传图片到谷歌存储
- html - angular - 加载组件时动画效果失败