jquery 可按 phone 点按排序
jquery sortable on phone tap
我正在使用 johnny/jquery-sortable 但它不适用于 phone。触摸事件会有一些问题,但我不知道在哪里。我的代码如下所示:
$('.sortableTBody').sortable({
handle: 'td.sortableTd',
event: 'touch',
helper: 'clone',
itemSelector: 'tr',
placeholder: '<tr class="sortablePlaceholder"><th></th><th class="short">drop there</th><th></th><th></th>',
onDrop: function ($placeholder, container, $closestItemOrContainer) {
var data = $('.sortableTBody').sortable("serialize").toArray();
var jsonString =JSON.stringify(data, null, ' ');
$.nette.ajax({
type: 'GET',
url: {link sort!},
data: {'data': jsonString}
})
}
});
我用touchpunch解决了,这里是link:
我正在使用 johnny/jquery-sortable 但它不适用于 phone。触摸事件会有一些问题,但我不知道在哪里。我的代码如下所示:
$('.sortableTBody').sortable({
handle: 'td.sortableTd',
event: 'touch',
helper: 'clone',
itemSelector: 'tr',
placeholder: '<tr class="sortablePlaceholder"><th></th><th class="short">drop there</th><th></th><th></th>',
onDrop: function ($placeholder, container, $closestItemOrContainer) {
var data = $('.sortableTBody').sortable("serialize").toArray();
var jsonString =JSON.stringify(data, null, ' ');
$.nette.ajax({
type: 'GET',
url: {link sort!},
data: {'data': jsonString}
})
}
});
我用touchpunch解决了,这里是link: