我正在尝试使用 Jquery 和 Php 进行类别更改。我对此没有问题。我的问题是,当调用更新事件时,它返回 2 个结果。拖动父项有 1 个结果,删除父项有 1 个结果。我只想拨打失联父母的身份证。这是我的脚本:
$("#gallery ul").sortable({
connectWith: '.dropBox',
opacity: 0.35,
scroll: true,
scrollSensitivity: 100,
//handle: '.move',
helper: 'clone',
containment:'#gallery',
accept:'#gallery > .photo',
revert: true,
update: function(event, ui){
params = 'c=' + $(this).attr('id') + '&id=' + ui.item.attr('id');
$.ajax({
type: 'POST',
url: 'processData.php',
data: params,
error:function(){
alert("Error!");
},
success:function(data){
$("#serverResponse").html(data);
}
});
}
}).disableSelection();
你们能帮我吗?
Use update
, stop
and receive
事件,例如
$(function() {
position_updated = false; //flag bit
$(".sortable").sortable({
connectWith: ".sortable",
update: function(event, ui) {
position_updated = !ui.sender; //if no sender, set sortWithin flag to true
},
stop: function(event, ui) {
if (position_updated) {
//code
position_updated = false;
}
},
receive: function(event, ui) {
// code
}
}).disableSelection();
});
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)