|
<SCRIPT language=javascript> function clickpimg(div_id){ if(eval(div_id).innerHTML==""||eval(div_id).style.display == "block"){ return "Images/folderopen.gif" } else { return "Images/folder.gif" } } function diva_show(div_id,clickp) { if (eval(div_id).style.display == "block") { eval(div_id).style.display = "none"; eval(clickp).src=clickpimg(div_id); //eval(statep).src="img/folder.gif"; } else { eval(div_id).style.display = "block"; eval(clickp).src=clickpimg(div_id); //eval(statep).src="img/folderopen.gif"; } } function openall(){ var DivLen=document.all.tags("Div") for(var i=0;i<DivLen.length;i++){ DivLen[i].style.display="" eval(DivLen[i].id.replace("a","f")).src="Images/folderopen.gif" } }
function closeall(){ var DivLen=document.all.tags("Div") for(var i=0;i<DivLen.length;i++){ DivLen[i].style.display="none" eval(DivLen[i].id.replace("a","f")).src="Images/folder.gif" } } function ShowuGetvalue(SortID,SortName,ParentID,LevelID){ parent.document.theform.SortID.value=SortID parent.document.theform.SortName.value=SortName parent.document.theform.ParentID.value=ParentID parent.document.theform.LevelID.value=LevelID } </SCRIPT> <!--#include file="Inc/Conn.asp" --> <% Response.CharSet="gb2312" Response.ContentType="text/html" Response.Expires = 0
%> <%
Sub Recur(SortID,SortName,ParentID,LevelID,Ecap) Dim sql,Treestr,Rs Set Rs=server.CreateObject("adodb.recordset") Rs.activeconnection=Conn Ecapstr="" for i=0 to Ecap Ecapstr=Ecapstr+"   " next Treestr=Ecapstr&"<img name=f"&SortID&" src=Images/folderopen.gif style=cursor:hand onclick=diva_show('a"&SortID&"','f"&SortID&"')>" Treestr=Treestr&"<a style=cursor:hand onclick=ShowuGetvalue('"&SortID&"','"&SortName&"','"&ParentID&"','"&LevelID&"');this.style.backgroundColor='#0099cc' onmouseout=this.style.backgroundColor=''>"&SortName&"</a><br>"&vbcrlf Treestr=Treestr&"<div id=a"&SortID&" >"&vbcrlf Response.write Treestr sql="select * from TbSort where ParentID="&SortID 'response.write sql If Rs.state=1 Then Rs.close Rs.open sql Do while Not Rs.eof SortID=Rs("SortID") SortName=Rs("SortName") ParentID=Rs("ParentID") LevelID=Rs("LevelID") call Recur(SortID,SortName,ParentID,LevelID,Ecap+1) Rs.movenext Loop Rs.close Set Rs=Nothing Response.write "</div>"&vbcrlf End sub SortID=Trim(Request("SortID")) SortName=Trim(Request("SortName")) ParentID=Trim(Request("ParentID")) LevelID=Trim(Request("LevelID")) call Recur(SortID,SortName,ParentID,LevelID,0) Conn.close Set Conn=Nothing %> <script> var DivLen=document.all.tags("Div") for(var i=0;i<DivLen.length;i++){ if(DivLen[i].innerHTML==""){ var DivID=DivLen[i].id eval("f"+DivID.replace("a","")).src="Images/folderopen.gif" } } /*alert(DivLen.length)*/ </script> 这段代码是什么意思啊!!!!!请哪位大虾知道告诉我啊! |
|