views:

51

answers:

1

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').sortable('serialize');
alert(serial);  
alert(serial1); 
alert(serial2);         
}

}); });

+1  A: 

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);         
}

}); });