我正在使用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