希望對你有用﹕
<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);
}
<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);
}
谁也不是你的代码工人,自己不想动手就想吃现成的,哪有那么美的事情
[email protected]
没有JS脚本