我正在使用jquery sortable和contenteditable问题是,当我使用jquery sortable contenteditable不工作,所以我搜索了stackoverflow我已经得到的解决方案,但是当我现在执行它的问题在mousedown事件排序不起作用。jQuery UI sortable&contenteditable = true
我在做什么工作。
Here is the stackoverflow link
<div class="sortable">
<div id="" style="background: #eee; width: 80%; margin: 10px auto; padding: 10px;">
<p contenteditable="true" style="padding: 5px;">Add your text here.</p> </div>
<div id="" style="background: #eee; width: 80%; margin: 10px auto; padding: 10px;">
<p contenteditable="true" style="padding: 5px;">Add your text here.</p> </div>
<div id="" style="background: #eee; width: 80%; margin: 10px auto; padding: 10px;">
<p contenteditable="true" style="padding: 5px;">Add your text here.</p> </div>
</div>
首先我使用此代码
$('.sortable').sortable();
其次,我使用此代码
$('.sortable').on('onmousedown', function() {
$(".sortable").sortable({
cursor: 'move'
});
})
变化onmousedown事件以mousedown.' $( '排序 ')。在(' 鼠标按下' 功能(){(“。sortable”)。sortable({0}){cursor:'move' }); })' – XYZ