1
我有以下的html:jQuery UI的可排序 - 子元素移動父項
<div class="wrapper">
<div class="box">
<div class="box__title">
<div class="box__move">move</div>
</div>
<div class="box__description">
</div>
</div>
<div class="box">
<div class="box__title">
<div class="box__move">move</div>
</div>
<div class="box__description">
</div>
</div>
</div>
我想「box__move」要移動的「包裝」中的「盒子」項目觸發。
我希望像下面這樣的東西可以工作,但沒有。所以,想知道是否真的有辦法做到這一點。
$('.box__move').sortable({
axis: 'y',
items: 'parent .box'
});
任何人都能夠幫助,或者這是不可能的?
你想 「box__move」 要移動的 「包裝」 中的 「盒子」 項目觸發。所以你的意思是你想讓用戶點擊box__move? – idmean
是的,這是正確的。用戶將點擊「box__move」拖動「框」 – AnthW