谁需要请留下EMAIL,以下是主要代码:var head="display:''"
img_close=new Image()
img_close.src="f.gif"
img_open=new Image()
img_open.src="fo.gif"
img3=new Image()
img3.src="e.gif";var elment = img_close.srcfunction onMouseDown(){
if(!document.all)return
var eventObj = event.srcElement;

if(eventObj.tagName=="IMG" ) {
//判断是否存在子频道
var sSrc = eventObj.src ;
if(sSrc == null || sSrc.length<=0)return;
if(sSrc.indexOf("tree-site")<0 && sSrc.indexOf("e.gif") >= 0)return; if(sSrc.indexOf("f")<0 && sSrc.indexOf("tree-site")<0 )return; var nOffIndex = 2;
var srcIndex = eventObj.sourceIndex;
var nested = document.all[srcIndex + nOffIndex];
if(nested.tagName!="DL"){
nested = document.all[srcIndex + 1];
}
if (nested.style.display=="none") {
nested.style.display='inline';
if(sSrc.indexOf("f.gif")>0 && sSrc.indexOf("tree-site")<0)
eventObj.src = img_open.src;
}
else {
nested.style.display="none";
if(sSrc.indexOf("fo.gif")>0 && sSrc.indexOf("tree-site")<0)
eventObj.src = img_close.src;
}

}else if(eventObj.tagName == "A" ){//相应频道的点击
var nChnlId = parseInt(eventObj.name);
if(!isNaN(nChnlId)){
onClickChannel(nChnlId);
}
}else if(eventObj.tagName == "INPUT" && eventObj.type == "checkbox" ){//频道选择框的点击
var nChnlId = parseInt(eventObj.id);
if(!isNaN(nChnlId)){
onClickChnlCheck(nChnlId);
}

}
//CloseOtherChnlTree(eventObj);
}
document.onclick=onMouseDown;//展开特定的节点
function expandOneChnlTree(_obj){
var pObj = _obj.parentElement;

while(pObj != null){
if(pObj.tagName == 'TD' || pObj.tagName == 'BODY'){
break;
}
if(pObj.tagName == 'DL'){
pObj.style.display = "inline";
//设置显示的图片为展开
setExpandImg(pObj);
}
pObj = pObj.parentElement;
}
}function CloseOtherChnlTree(){
var dlCount = document.all.tags("DL");
var srcIndex ;
var nested ;
 for (var i=0; i<dlCount.length; i++) 
  {     if (dlCount(i)!=event.srcElement ) 
           
       {if (dlCount(i).innerText!="创锋数码科技有限公司")
              { srcIndex= dlCount(i).sourceIndex;
                nested = document.all[srcIndex];
           nested.style.display="none";
         dlCount(i).src = img_close.src;
         }        
  }
  }


}
function setExpandImg(_pObj){
var nOffIndex = 2;
var srcIndex  = _pObj.sourceIndex;
var imgExpand = document.all[srcIndex - nOffIndex];
//alert(imgExpand.outerHTML);
if(imgExpand == null)return;
if(imgExpand.tagName != "IMG"){
//向前再取3次
for(var i=1; i<4 && imgExpand.tagName != "IMG"; i++){
imgExpand = document.all[srcIndex - nOffIndex - i];
if(imgExpand == null)return;
}
}
//不是Image对象
if(imgExpand.tagName != "IMG")return;
//站点的图片
if(imgExpand.src.indexOf("tree-site.gif") >= 0)return;
imgExpand.src = img_open.src;
}

解决方案 »

  1.   

    以上代码为tree-relate.js文件,下面是WEB中调用
    <SCRIPT src="tree-relate.js"></SCRIPT><SCRIPT>
    //相应频道链接上点击的操作,可以重载
    function onClickChannel(_nChnlId){
    var Flag=event.srcElement.innerText;
    if (Flag=="产品管理")
    {top.frames[2].location.href="ViewProduct.asp";
    }
    else if (Flag=="员工管理")
    {top.frames[2].location.href="ViewEmployInput.asp";
    }
    else if (Flag=="客户管理")
    {top.frames[2].location.href="ViewCustomer.asp";}else if (Flag=="供应商管理")
    {top.frames[2].location.href="ViewFactory.asp";}else if (Flag=="密码修改")
    {top.frames[2].location.href="UpdatePwd.asp";}
    else
    {top.frames[2].location.href="test.htm";
    }// alert("您点击了频道["+event.srcElement.innerText+"]  频道号为["+_nChnlId+"]")
    //onChnlClick(_nChnlId);
    }
    </SCRIPT>
    <IFRAME src="about:blank" width=0 height=0></IFRAME><!--频道树JS END-->
    <SCRIPT>
    <!---
    document.admin=1;-->
    </SCRIPT><DIV id=TreeHtml noWrap style="WIDTH: 156px; HEIGHT: 176px"> <DL>
      <DD><IMG height=16 src="tree-site.gif" width=16><b class=blue 
       Site="1" wisehero="" ChnlId="0" 
      SiteId="2" menuShow="1" 
      MenuIndex="0" 
      MenuType="2">创锋数码科技有限公司</b> 
      <DL SiteId="2"><!-- <DD><IMG src="e.gif" width="34" height="15"><A name=31>滚动新闻</A> -->
        <DD><IMG height=15 src="f.gif" width=34><font name=1000 color="#800000">档案管理</font> 
        <DL style="DISPLAY: none"><!-- <DD><IMG src="f.gif" width="34" height="15"><A name=104>外交部长</A> 
          <DL style="DISPLAY: none">-->
            <DD><IMG height=15 src="e.gif" width=34><A name=1001 >产品管理</A> 
            <DD><IMG  height=15 src="e.gif" width=34 ><A name=1002>供应商管理</A>
            <DD><IMG  height=15 src="e.gif" width=34 ><A name=1002>客户管理</A>  
            <DD><IMG height=15 src="e.gif" width=34><A name=1003>员工管理</A> </DD></DL>
            
            <DD><IMG height=15 src="f.gif" width=34><font name="2000" color="#800000">进销管理</font> 
        <DL style="DISPLAY: none">
       
          
             <DD><IMG height=15 src="f.gif" width=34><font name="2001" color="#800000">进货</font> 
        <DL style="DISPLAY: none">
        <DD><IMG height=15 src="e.gif" width=34><A name=20011>样品进货</A>
        <DD><IMG height=15 src="e.gif" width=34><A name=20012>现货进货</A>
         <DD><IMG height=15 src="e.gif" width=34><A name=20013>询价管理</A>
        
        </DD></DL>        
            <DD><IMG height=15 src="e.gif" width=34><A name=2002>出货</A> 
            <DD><IMG height=15 src="e.gif" width=34><A name=2003>退货</A> </DD></DL>
            
            <DD><IMG height=15 src="f.gif" width=34><font name=3000 color="#800000">系统功能</font> 
        <DL style="DISPLAY: none">
       
            <DD><IMG height=15 src="e.gif" width=34><A name=3001>角色设置</A> 
            <DD><IMG height=15 src="e.gif" width=34><A name=3003>数据备份</A> 
            <DD><IMG height=15 src="e.gif" width=34><A name=3004>密码修改</A> </DD></DL>
         
       </DD></DL></DD></DL></DIV>
      

  2.   

    [email protected]
    谢谢了先!
      

  3.   

    到下个星期一发代码,相信一定给大家一个惊喜,以后在WEB上不用再为树发愁了
      

  4.   

    请以下人查收邮件!!!
    [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
      

  5.   

    [email protected]
    --------------
      

  6.   

    我也想要!!!!
    [email protected]
      

  7.   

    我也想要!谢谢!
    [email protected]
      

  8.   

    我非常想要!谢谢!!
    [email protected]
      

  9.   

    [email protected]
    谢谢楼主!!!
      

  10.   

    兄台我都想要啊!!
    3q
    [email protected]
      

  11.   

    是不是可以改成Delphi的再发布一下.
      

  12.   

    这段时间一直在WEB版块,好久没有来过了,希望收到邮件的朋友过来发表以下意见,以下是我第二次名单,截止到 wilsonlee(卡卡)[email protected] 
    Cc: [email protected] ; [email protected] ; [email protected] ; [email protected] ; [email protected] ; [email protected] ; [email protected] ; [email protected] ; [email protected] ; [email protected] 
      

  13.   

    [email protected]
    B/S下很有用啊!
      

  14.   

    [email protected]  给我也发一份好吗?多谢!
      

  15.   

    给我也发一份:[email protected]
    谢谢
      

  16.   

    [email protected]
    我提供个演示好了