lz要问啥?!图片当然事先做好滴,
用js控制显隐或者更改图片地址均可实现切换效果!

解决方案 »

  1.   

    页面上内容:<table>
    <TR ID='JSYD' ParentID='114E' Depth='1' Class='Node-Hidden'><TD title='test' style='padding-left:1em' noWrap='true'><IMG SRC='plus.gif' style="cursor:hand;" onClick=clickNode('JSYD')></IMG>&nbsp;<A href=# onclick=clickNode('JSYD')>test</A></TD></TR>
    <TR ID='111' ParentID='JSYD' Depth='2' Class='Node-Hidden'><TD title='test1' style='cursor:hand;padding-left:2em' noWrap='true'>&nbsp&nbsp&nbsp<A href=#' target='_blank'>test1</A></TD></TR>
    <TR ID='112' ParentID='JSYD' Depth='2' Class='Node-Hidden'><TD title='test2' style='cursor:hand;padding-left:2em' noWrap='true'>&nbsp&nbsp&nbsp<A href=#' target='_blank'>test2</A></TD></TR>
    </table>js函数:  {
        thisRow = document.all.item(id);
       
        if(thisRow)  
          {
            //已经展开
            if(thisRow.getAttribute("Expanded") == "yes"){
                
                thisRow.setAttribute("Expanded","no");
                thisRow.children(0).children(0).src = "plus.gif";
                var allRows = document.all.tags("TR");
                for(var i=0;i<allRows.length;i++){
                    var row = allRows[i];
                    if(row.getAttribute("ParentID") == id && row.getAttribute("ID") != id){            
                       row.className = "Node-Hidden";                   
                       if(row.getAttribute("Expanded") == "yes")
                          clickNode(row.getAttribute("ID"));
                        
                    }
                    
                }
            }
           //没有展开
            else{
                
                thisRow.setAttribute("Expanded","yes");
                thisRow.children(0).children(0).src = "minus.gif";
                var allRows = document.all.tags("TR");
                for(var i=0;i<allRows.length;i++){
                     var row = allRows[i];
                     if(row.getAttribute("ParentID") == id)
                         row.className = "Node";                     
                     
                }
                    
            }
          }
          
      }
    图片:minus.gif
    plus.gif
      

  2.   

    图片切换很简单L@_@K
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title> new document </title>
        <meta name="generator" content="editplus" />
        <meta name="author" content="Gao YiXiang" />
        <meta name="email" content="[email protected]" />
        <meta name="keywords" content="javascript dhtml dom" />
        <meta name="description" content="I love web development." />
    </head>
    <body>
        <input type="button" id="btnChange" value="Show Baidu Logo" /><br />
        <img src="http://www.google.cn/intl/zh-CN/images/logo_cn.gif" alt="google" id="imgTest" />
        <script type="text/javascript">
        <!--
    var oBtn = document.getElementById("btnChange");
    var oImg = document.getElementById("imgTest");
    oBtn.onclick = function()
    {
        oImg.src = "http://www.baidu.com/img/logo.gif";
        oImg.alt = "baidu";
    };
        //-->
        </script>
    </body>
    </html>
      

  3.   

    不用改图片地址吧,直接改css就行了,一般改变+-往往样式会有变化直接改class,在程序里还可以通过class的判断知道现在是+还是-
     css里面可以通过背景属性显示+-
      

  4.   

    不用改图片地址吧,直接改css就行了,一般改变+-往往样式会有变化直接改class,在程序里还可以通过class的判断知道现在是+还是- 
      css里面可以通过背景属性显示+---------------------------------------大哥麻烦给个例子看看.谢谢.:-)
      

  5.   

    <html>
    <head>
    <style>
    .node{
    text-decoration: none ;
    }
    .open{
    cursor: hand ; 
    background-image : url(minus.gif) ;
    background-repeat:no-repeat;
    }
    .closed{
    cursor: hand ; 
    background-image : url(plus.gif) ;
    background-repeat:no-repeat;
    }
    </style>
    </head>
    <body> 
        <a class="node" href="javascript:void('')"><span class="open" onclick="this.className=this.className=='open'?'closed':'open'">&nbsp;&nbsp;</span></a>
    </body>
    </html>高 宽等自己调吧 其实怎么实现都一样,能实现就可以了