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);
}
}); });
精彩评论