简体   繁体   English

jQuery排序无法正常工作?

[英]jquery sortable can not work?

Could anyone can tell me how to add effect to all divs? 谁能告诉我如何增加所有div的效果?

jQuery: 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 我有2个div,其ID为sortable_list1

item1 item2 item1 item2 item1 item2 item1 item2

but it only first sortable_list1 can be serialize.how to sorable second or more? 但是只有第一个sortable_list1可以序列化。如何存储第二个或更多? thanks 谢谢

You can't have two elements with same id. 您不能有两个具有相同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... id是用于标识页面上元素的属性,因此建议您不要向其添加两个具有相同id的div,而是建议您向它们添加相同的类,然后执行$('div.yourGivenClass').sortable...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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