开发者

JQuery duplicate alerts on update? why?

I have this JQuery function - that nearly works (so far!) BUT the alerts are duplicated, each appears twice any clues/ideas please

$(function() {
$("#col1, #col2, #col3").sortable({
connectWith: '.column',
update : function () {
serial = $('#col1').sortable('serialize');
serial1 = $('#col2').sortable('serialize');
serial2 = $('#col3').开发者_Go百科sortable('serialize');
alert(serial);  
alert(serial1); 
alert(serial2);         
}

}); });


Solved by changing update to stop

$(function() {
$("#col1, #col2, #col3").sortable({
connectWith: '.column',
stop : function () {
serial = $('#col1').sortable('serialize');
serial1 = $('#col2').sortable('serialize');
serial2 = $('#col3').sortable('serialize');
alert(serial);  
alert(serial1); 
alert(serial2);         
}

}); });

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜