但是如何保存顺序呢,想到了cookie,但是用如何用cookie保存顺序呢,直接保存html代码下次读取覆盖可以,但是总感觉内容多的话 保存的东西比较多,后用ui插件获取id保存id在读取实现了顺序的保存,废话不多说..直接看代码... 复制代码 代码如下: <BR>div <BR>{ <BR>border: 1px solid red; <BR>} <BR>#myList <BR>{ <BR>padding-top: 20px; <BR>width: 500px; <BR>background: #EEE; <BR>list-style-type: none; <BR>} <BR>#myList li <BR>{ <BR>height: 30px; <BR>cursor: pointer; <BR>margin: 20px; <BR>border: 1px solid blue; <BR>} <BR>#myList a <BR>{ <BR>text-decoration: none; <BR>color: #0077B0; <BR>} <BR>#myList a:hover <BR>{ <BR>text-decoration: underline; <BR>} <BR>#myList .qlink <BR>{ <BR>font-size: 12px; <BR>color: #666; <BR>margin-left: 10px; <BR>} <BR> <BR>$(function() { <BR>$("#myList").sortable({ delay: 1, containment: "div", connectWith: ".otherlist", stop: function() { <BR>//alert($("#myList").sortable("serialize")); <BR>//alert($("#myList").sortable("toArray")); <BR>$.cookie("myCookie", $("#myList").sortable('toArray'), { expires: 7 }) <BR>} <BR>}); <BR>$(".qlink").click(function() { <BR>alert(this.className); <BR>}); <BR>if ($.cookie("myCookie")) { <BR>var ids = $.cookie("myCookie").split(","); <BR>for (var i = 0; i < ids.length; i++) { <BR>$("#" + ids[i]).appendTo("#myList"); <BR>} <BR>} <BR>}); <BR> 心情 相册 上传 日志 发表 投票 分享 群组 呵呵.. 这下看到了效果,不足方面望高手赐教....