希望對你有用﹕
<HTML xmlns:v="urn:schemas-microsoft-com:vml">
function drawrect(divid,left,top,color,hd,wd,index,content,alertcontent)  
{
var titlestring="TempID:"
+alertcontent.split(',')[0]
    +"\n編號:"
    +alertcontent.split(',')[1]
    +"\n父件:"+alertcontent.split(',')[2]
    +"\n產品:"+alertcontent.split(',')[3]
        +"\n用量r:"+alertcontent.split(',')[4]
        +"\n累計用量:"+alertcontent.split(',')[5]
        +"\損耗:"+alertcontent.split(',')[6]
        +"\n工程單位:"+alertcontent.split(',')[7]
            +"\n是否是為葉子:"+alertcontent.split(',')[8]
            +"\n是否應顯示:"+1
            +"\n層ID:"+divid
var html="<div id="+divid+" nodeid="+index+" class=flowdiv title='"+titlestring+"' alt='"+alertcontent+"' "+
"onclick=EditData(this) onmouseover=mouseover(this) onmouseout=mouseout(this) oncontextmenu=rightmouse("+index+")"+
" style=visibility:visible;position:absolute;cursor:hand;background-color:"+color+";top:"+top+";left:"+left+";"+
"width:"+wd+";height:"+hd+";filter:alpha(style=0)><center><br>"+content.length+"</center></div>";
document.body.insertAdjacentHTML("beforeEnd",html);
 
return document.getElementById(divid);
}
function lineTo(lineindex,linetype,fromdiv,todiv)  
{ var html=""
   
var astr="<v:stroke EndArrow='classic'/>"; //EndArrow  StartArrow
if (linetype=="in")
html="<v:line strokeweight='1pt' strokecolor=black style='visibility:visible;position:absolute;' id="+lineindex+" "+
"from='"+parseInt(TreeX[todiv]+TreeWidth[todiv]/2)+","+parseInt(TreeY[todiv]-TreeHeight[todiv])+"' to='"+parseInt(TreeX[todiv]+TreeWidth[todiv]/2)+","+parseInt(TreeY[todiv])+"'"+
">"+astr+"</v:line>";

if (linetype=="center")
html="<v:line strokeweight='1pt' strokecolor=black style='visibility:visible;position:absolute;' id="+lineindex+" "+
"from='"+parseInt(TreeX[fromdiv]+TreeWidth[fromdiv]/2)+","+parseInt(TreeY[fromdiv]-TreeHeight[fromdiv])+"' to='"+parseInt(TreeX[todiv]+TreeWidth[todiv]/2)+","+parseInt(TreeY[fromdiv]-TreeHeight[fromdiv])+"'"+
"></v:line>"; if (linetype=="out")
{ //LineIndex[fromdiv]=lineindex
html="<v:line strokeweight='1pt' strokecolor=black ondblclick=lineondblclick("+fromdiv+") title='雙擊我可以進行伸縮噢!' style='visibility:visible;position:absolute;' id="+lineindex+" "+
"from='"+parseInt(TreeX[fromdiv]+TreeWidth[fromdiv]/2)+","+parseInt(TreeY[fromdiv]+TreeHeight[fromdiv]*1.5)+"' to='"+parseInt(TreeX[fromdiv]+TreeWidth[fromdiv]/2)+","+parseInt(TreeY[todiv]-TreeHeight[todiv])+"'"+
">"+astr+"</v:line>";
}

document.body.insertAdjacentHTML("beforeEnd",html);
//alert("X is : " + parseInt(TreeX[todiv]+TreeWidth[todiv]/2)+" and Y is : " + parseInt(TreeY[todiv]+TreeHeight[todiv]/2))

return document.getElementById(lineindex);
}

解决方案 »

  1.   

    csdn 连这个问题都解决不了, 不如关闭了算!!
      

  2.   

    "csdn 连这个问题都解决不了, 不如关闭了算!!"
    谁也不是你的代码工人,自己不想动手就想吃现成的,哪有那么美的事情
      

  3.   

    我也正研究这个问题,我的思路是用vml或者svg
      

  4.   

    呵呵,居然能碰到一个做偶同样事情的人痛快痛快楼主加偶的MSN吧?
    [email protected]
      

  5.   

    这个的交互操作要比那个js星际要简单吧,楼主不妨联系一下js星际的作者,探讨下层、线的实现这个问题不是可以在这里帖得出代码的
      

  6.   

    js星际 里面的操作都是封装在flash里面的
    没有JS脚本