我正在使用jquery UI排序。每次我從resultPos獲得值時,它都會給我最後一招,但要記住最後一個訂單。我需要重置它。從jquery UI排序重置排序
例如,我有3個要素:
Move 3rd element to 2nd position: end=1&end=3&end=2
Again ...
Move 3rd element to 2nd position: end=1&end=2&end=3
Again ...
Move 3rd element to 2nd position: end=1&end=3&end=2
我需要有一個回我下面的內容:
Move 3rd element to 2nd position: end=1&end=3&end=2
Again ...
Move 3rd element to 2nd position: end=1&end=3&end=2
Again ...
Move 3rd element to 2nd position: end=1&end=3&end=2
這是我的代碼:
$(".sortableChip").sortable({
revert: true,
containment: "#carousel",
axis: "x",
items: 'li.edited',
tolerance: 'pointer',
placeholder: 'draggin-space',
start: function(event, ui) {
var startPos = $('.sortableChip').sortable('serialize',{ key: 'start'});
},
sort: function(event, ui) {
ui.item.addClass('draggin');
$('.remove-chart').hide();
},
update: function(event, ui) {
var resultPos = $('.sortableChip').sortable('serialize',{ key: 'end'});
ui.item.removeClass('draggin');
}
});
This site http://forum.jquery.com/topic/jquery-how-do-i-re-the-original-positions-of-a-sortable-list -using-sort-method不能幫助我:( – todotresde 2012-04-18 20:33:18