有的话,再送我一个
[email protected]

解决方案 »

  1.   

    楼主留下你的MSN,我给你一个!
      

  2.   

    [email protected],谢谢楼上的~!
      

  3.   

    TO  seaman0916(沙漠孤鹰)   
    你把代码能贴的的就贴出来吧
    呵呵
      

  4.   

    随便去找一个用javascript,然后分析一下代码,将动态的部分用jsp代码替换。。
    javascript网络上多的是。
      

  5.   

    http://champion.ewuxi.com/old/opensource/struts-new/strutsmenudy.htm
      

  6.   

    http://expert.csdn.net/Expert/topic/2770/2770492.xml?temp=5.624026E-02
      

  7.   

    这个很简单,也是从这里找的,自己写了jsp文件,你看看如何:
    simple_tree.js文件:
    img_close=new Image();
    img_close.src="image/tree/f.gif";
    img_open=new Image();
    img_open.src="image/tree/fo.gif";
    img3=new Image();
    img3.src="image/tree/e.gif";var strStyle='<style type="text/css">';
    strStyle+='span.SelectIng{color:#007BCE; border:solid 0pt #666666; padding:0.5pt; height:4px; background-color:#FFFFFF; text-decoration: underline;}';
    strStyle+='span.NoSelect{color:#007BCE; border:solid 0pt #FFFFFF; padding:0.5pt; height:4px; background-color:#FFFFFF; text-decoration: none;}';
    strStyle+='span.SelectEd{color:#FF0000; border:solid 0pt #888888; padding:0.5pt; height:4px; background-color:#FFFFFF; text-decoration: underline;}';
    strStyle+='</style>';
    document.write(strStyle);var myRs=new Array(),selectItem;
    function compare(a,b){return parseInt(a[1]) - parseInt(b[1])}
    function InsertItem(s){myRs[myRs.length++] = s.split(/,/);}function ExCloAll(n){
      var d=document.all('0'),e=d.all.tags('div');
      for(i=0;i<e.length;i++)e[i].style.display=(n==1?'block':'none');
      e=d.all.tags('p');
      for(i=0;i<e.length;i++){if(ChkExist(e[i].children[1].value))e[i].children[0].innerText=(n==1?'|-':'+ ');}
    }function ExCloItem(){
      var c,e=event.srcElement,p=e.parentElement.children;
      if(e.myHref!=''){
    eval((e.myTarget!=''?e.myTarget:'window')+'.location="'+e.myHref+'"');
    //要改成連接到某頁只需把alert改成eval即可
    //如果你不想觸發展合動作只需在這里加return;
      }
      else{window.status='no href'};
      if(selectItem!=null) selectItem.className='NoSelect';
      e.className='SelectEd';
      selectItem=event.srcElement;
      if(c=document.all(e.value)){
    p[0].innerText=(p[0].innerText=='+ '?'- ':'+ ');
    c.style.display=(c.style.display=='none'?'block':'none');
      }else{p[0].innerText='- ';}
    }function ExCloItem2(){
      var c,e=event.srcElement,p=e.parentElement.children;
      if(c=document.all(p[1].value)){
    e.innerText=(e.innerText=='+ '?'- ':'+ ');
    c.style.display=(c.style.display=='block'?'none':'block');
      }else e.innerText='- ';
    }function OutItem(){
      var e=event.srcElement;
      if(selectItem != '') e.className=(selectItem==e?'SelectEd':'NoSelect');
      else e.className='NoSelect';
    }function ChkExist(n){
      n=parseInt(n);
      if((n<myRs[0][1])||(n>myRs[myRs.length-1][1])) return false;
      var a,b,c,x=0,y=parseInt(myRs.length/2),z=myRs.length-1;
      while((x!=y)&&(y!=z)){
    a=myRs[x][1],b=myRs[y][1],c=myRs[z][1];
    if(n==a||n==b||n==c) return true;
    if(n>b)x=y;
    else z=y;y=parseInt(x+z);
    y=parseInt((x+z)/2);
      }
      return false;
    }function drawTree(n){
      if(n==0){
    myRs.sort(compare);
      }
      if(ChkExist(n)!=true) return;
      document.write('<div id="'+n+'" style="font-family: GBK; font-size: 9pt; line-height: 16px; cursor:hand;'+(n!=0?'position:relative;left:20;display:none;':'')+'">');
      for(var i=0;i<myRs.length;i++){
        if(parseInt(myRs[i][1])>n) break;
      if(myRs[i][1]==n){
    document.write('<p style="color:#007BCE;margin:0pt;"><span style="vertical-align:top;" onclick="ExCloItem2()">'+(ChkExist(myRs[i][0])?'+ ':'|-')+'</span>');
    document.write('<span onclick="ExCloItem()" myHref="'+(myRs[i].length>3?myRs[i][3]:'')+'" myTarget="' + (myRs[i].length>4?myRs[i][4]:'') +'" value="'+myRs[i][0]+'" class="NoSelect" onmouseout="OutItem()" onmouseover="this.className=\'SelectIng\'">'+myRs[i][2]+'</span></p>');
    if (myRs[i].length >3)document.write('</a>');
    drawTree(myRs[i][0]);
      }
    }
    document.write('</div>');
    }simple_tree.jsp:
    <%!
      /*树形结构*/
      void Tree(MenuMan menuMan,String highter_menu,JspWriter out) throws Exception{
    Tb_menu[] menuList = menuMan.getMenuList(highter_menu);
    for(int i=0;i<menuList.length;i++){
      Tb_menu menu = menuList[i];
          out.print("InsertItem('"+menu.getMenu_id()+","+highter_menu+","+menu.getMenu_name()+","+menu.getMenu_data()+",parent.main');\n");
          Tree(menuMan,String.valueOf(menu.getMenu_id()),out);
    }
      }
      /*显示树*/
      void showTree(MenuMan menuMan,String startNode,JspWriter out) throws Exception{
    out.print("<script language='JavaScript'>\n");
    Tree(menuMan,startNode,out);
    out.print("drawTree("+startNode+");\n");
    out.print("</script>");
      }
    %>
    <%
      MenuMan menuMan = new MenuMan();
    %>
    <html>
    <head>
    <title>导航菜单</title>
    <link href="../../css/css.css" rel="stylesheet" type="text/css">
    <script language="JavaScript" src="../../jscript/simple_tree.js"></script>
    </head>
    <body>
    <%showTree(menuMan,"0",out);%>
    </body>
    </html>
      

  8.   

    http://www.raibledesigns.com/struts-menu/index.jsp
    这个地方的数形结构不错~!