简体   繁体   中英

jquery sortable can not work?

Could anyone can tell me how to add effect to all divs?

jQuery:

data = $("#sortable_list1").sortable("serialize");

update:function()
        {    

            $.ajax({
                data:serial,
                url:"list.php",
                type:"post",
                success:function(data){
                $("#serverResponse").html(data);
                }
            });             
        }

Html:

I have 2 divs which id is sortable_list1

item1 item2 item1 item2

but it only first sortable_list1 can be serialize.how to sorable second or more? thanks

You can't have two elements with same id. Id is an attribute that identifies the element on a page, so instead of having two divs with same id i'd suggest you adding same class to them and then doing $('div.yourGivenClass').sortable...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM