现在有两个sortable    
已经实现了他们之间的互相拖动
在IE9 FF Chrome上也都可以实现他们的效果但是、、、在IE的6~8的几个版本上就出错了
一拖动下面的sortable中的某个Item 他就往下跑 
各种乱跑 ~~~~~ 
图一:
图二:
图三:

解决方案 »

  1.   

    好的   来码:
      <div id="newsList2" style="width: 850px; text-align: left; margin-top: 20px;"></div>    <script type="text/javascript">        $(function() {
                //保存排序后的状态
                var list = $.cookie("list"); //获取cookie里的list值
                if (list != null && list != "") {
                    var arrColumn = list.split('|'); //list-----1:40100000115@40000018813@|2:40000018331@|3:|4:|5:|
                    $.each(arrColumn, function(m, n) {                    var elemId = n.split(':')[0]; //分类ID
                        //alert(elemId)
                        if (elemId != null && elemId != "") {
                            var html = "";
                            html += connectValue(elemId);
                            $("#newsList2").append(html);
                        }
                        var arrRow = n.split(':')[1] ? n.split(':')[1].split('@') : ""; //单个新闻ID                    $.each(arrRow, function(m, n) {
                            if (n) {//排除空值
                                $("#" + elemId).append($("#" + n).attr('id', n)); //把序列填加进容器
                            }
                        });
                    });
                } else {
                    var html = "";
                    for (var i = 1; i <= 5; i++) {
                        html += connectValue(i);                }
                    $("#newsList2").append(html);
                }            //排序
                $("#newslist").sortable();            $("#newsList2").sortable({ stop: saveLayout});
                $("#newslist").sortable({ connectWith: '.newstype', stop: saveLayout});
                $("#newslist").sortable({ connectWith: '#newsList2', start: function() {
                    alert(13);
                    $("#newsList2").addClass("newsList2 li");
                }, stop: saveLayout, helper: 'clone'
                });
                $(".newstype").sortable({
                connectWith: '.newstype', start: function() {
                    alert(14);
                    $("#newsList2 li").addClass("newsList2 li");
                },
                    stop: saveLayout
                });
                var connectWith = $("#newslist").sortable("option", "connectWith");
                $("#newslist").sortable("option", "connectWith", '.newstype');            var connectWith = $(".newstype").sortable("option", "connectWith");
                $(".newstype").sortable("option", "connectWith", '#newslist');            $(".newstype").disableSelection();
                //点击"下一步"
                $("#btnNext,#btnNext_copy").click(function() {
                    //返回以“,”分割的id,为了“下一步”显示使用
                    var listForNext = "";
                    $.each($(".newstype"), function(m) {
                        listForNext += $(this).attr('id') + ",";
                        $.each($(this).children(".ui-state-default"), function(d) {
                            listForNext += $(this).attr('id') + ",";
                        })
                    })                $("#newsIDs").val(listForNext);
                });        });
            //保存排序后的顺序
            function saveLayout() {            //保存状态,为了点击“上一步”使用
                var list = "";
                $.each($(".newstype"), function(m) {
                    list += $(this).attr('id') + ":";
                    $.each($(this).children(".ui-state-default"), function(d) {
                        list += $(this).attr('id') + "@";
                    })
                    list += "|";
                })            $.cookie("list", list)
                //alert (list)
            }        //通过分类Id拼接
            function connectValue(typeid) {
                typename = getNameByID(typeid);
                var html = "";
                html += "<div class='newstype' id='" + typeid + "'><span class='newsfont'>";
                html += typename + "</span></div><br />";            return html;
            }        //通过分类ID得到分类名字
            function getNameByID(typeid) {
                var typename = "";
                if (typeid == "1") {
                    typename = "Reading Recommendation【编辑推荐】";
                } else if (typeid == "2") {
                    typename = "Legal Updates【法 律】";
                } else if (typeid == "3") {
                    typename = "TAA Updates【财 税】";
                } else if (typeid == "4") {
                    typename = "HR Updates【劳动法】";
                } else if (typeid == "5") {
                    typename = "Case Spotlight【案件聚焦】";
                }
                return typename;
            }    </script>
      

  2.   

    <style>
    #newsList2
            {
                list-style-type: none;
            }
            #newsList2 li
            {
                margin: 0 3px 3px 3px;
                padding: 0.4em;
                padding-left: 1.5em;
                height: 18px;
                text-align: left;
            }
            #newsList2 li #icon1
            {
                position: absolute;
                margin-left: -1.3em;
            }
            .newstype
            {
                border: solid 1px green;
                margin-bottom: 10px;
            }
            .newsfont
            {
                font-size: 14pt;
                font-weight: bold;
            }
    </style>