好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

简陋的树形控件_html/css_WEB-ITnose

                      function rootClicked(v)        {            var newItem=document.createElement("div");            $(newItem).addClass("item");            var Line=document.createElement("div");            $(Line).addClass("line");            var newNode=document.createElement("div");            $(newNode).addClass("node");            var innerBtn=document.createElement("button");            $(innerBtn).html("addNode");            $(innerBtn).attr("onclick","addChild(this)");            var newWrapper=document.createElement("div");            $(newWrapper).addClass("nodeWrapper");            $(newNode).append(innerBtn);            $(newItem).append(Line);            $(newItem).append(newNode);            $(v).parent().next().append(newItem).append(newWrapper);        }        function addChild(v)        {            var newItem=document.createElement("div");            $(newItem).addClass("item");            var Line=document.createElement("div");            $(Line).addClass("line");            var newNode=document.createElement("div");            $(newNode).addClass("node");            var innerBtn=document.createElement("button");            $(innerBtn).html("addNode");            $(innerBtn).attr("onclick","addChild(this)");            var newWrapper=document.createElement("div");            $(newWrapper).addClass("nodeWrapper");            $(newNode).append(innerBtn);            $(newItem).append(Line);            $(newItem).append(newNode);            //$(v).parent().parent().parent().children().last().css("background-color","black");            //$(v).parent().parent().next().css("background-color","blue");            //if($(v).parent().parent().next()[0]===$(v).parent().parent().parent().children().last()[0])            //{            //    $(newWrapper).css("border-left","white");            //}            //else            //{            //    $(v).parent().parent().parent().children().last().css("border-left","1px dotted #9c9c9c");            //}            $(v).parent().parent().next().append(newItem).append(newWrapper);        }                        .root        {            width:100px;            height:30px;            background-color: #e12249;            border:2px solid #a6a6a6;            border-radius: 4px;        }        .item        {            float:left;            clear:both;        }        .line        {            width:70px;            height:50px;            border-bottom:1px dotted #9c9c9c;            border-left:1px dotted #9c9c9c;            float:left;        }        .node        {            width:100px;            height:30px;            background-color: #e12249;            border:2px solid #a6a6a6;            border-radius: 4px;            float:left;            position:relative;            top:34px;        }        .nodeWrapper        {            float:left;padding-left:120px;clear:both;z-index: 0;border-left: 1px dotted #9c9c9c;        }       

addNode

查看更多关于简陋的树形控件_html/css_WEB-ITnose的详细内容...

  阅读:29次