如何使用jquery.treeview.js控件,显示树形菜单??

解决方案 »

  1.   


    <html>
    <head>
    <%@ include file="/WEB-INF/pages/public/commons.jspf"%>
    <script type="text/javascript" src="${basePath }/widgets/jquery.treeview/lib/jquery.cookie.js"></script>
    <script type="text/javascript" src="${basePath }/widgets/jquery.treeview/jquery.treeview.js"></script>
    <link rel="stylesheet" href="${basePath }/widgets/jquery.treeview/jquery.treeview.css" />

    <script type="text/javascript">
    function doLogout(){
    var url = '<html:rewrite action="/user.do?method=logout"/>';
    if(window.confirm("您确定要注销吗?")){
    window.parent.location.href = url;
    }
    }
    $(".menu").treeview({
    persist: "location",
    collapsed: true,
    unique: true
    });
    </script>
    </head> <body style="margin: 10px; font-size: 14px;">
    <ul class="menu treeview-famfamfam" style="list-style: disc;">
    <li><a href="javascript:doLogout()">注销 [${sessionScope["SESSION_LOGGED_ON_USER"].nickname}]</a></li>
    <li><html:link target="_parent" action='/portal?method=index'>论坛首页</html:link></li>
    <li>---------------</li>
    <li><html:link target="right" action='/manage/category?method=list'>版面管理</html:link></li>
    <li><html:link target="right" action='/manage/role?method=list'>角色管理</html:link></li>
    <li><html:link target="right" action='/manage/user?method=list'>会员管理</html:link></li>
    <li><html:link target="right" action='/manage/topicSearch?method=list'>主题搜索管理</html:link></li>
    <li><html:link target="right" action='/manage/blogLink?method=list'>博客链接管理</html:link></li>
    <li><a href='#'>系统设置</a></li>
    </ul>
    </body>
    </html>
    我的页面中,jquery.treeview没有起到作用??
      

  2.   

    http://94this.com.cn/article/288.htm
      

  3.   

    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>书籍评价搜索系统</title>
    <!--<link rel="stylesheet" href="css/jquery.treeview.css" type="text/css" />
    --><link rel="stylesheet" href="jquery.tree.css" type="text/css" />
    <link rel="stylesheet" href="css/screen.css"  type="text/css"/>
    <link rel="stylesheet" href="css/window.css" type="text/css" />
    <script src="js/jquery-1.4.2.js" type="text/javascript"></script>
    <script src="js/jquery.js" type="text/javascript"></script>
    <script src="js/jquery.cookie.js" type="text/javascript"></script>
    <!--<script src="js/jquery.treeview.js" type="text/javascript"></script>
    <script src="js/jquery.treeview.edit.js" type="text/javascript"></script>
    <script src="js/jquery.treeview.async.js" type="text/javascript"></script>
    --><script src="js/jquery.tree.js" type="text/javascript"></script>
    <!--<script src="js/window.js" type="text/javascript"></script>
    --><!--<script src="js/tree1.js" type="text/javascript"></script>
    --><script type="text/javascript">
    $(document).ready(function(){
    var o={
    url:"sendNode",
    onnodeclick:function(){
    alert($(this).attr("title"));
    }
    };
    //o.data=treedata;
    $.ajax({
    url: o.url,
    type: "POST",
    // async: false,
    data: {
    id: "0"
    },
    success: function(treedata){
    o.data = treedata;
    $("#top2").treeview(o);
    }
    });

    });
    </script></head><body>
    <div id="main">
    <div id="left">
    <div id="top">
    <div id="top1">
    <form>
    <label><span class="STYLE1">请输入:</span></label>
    <input type="text" id="name" style="width:300px; font-style:inherit; margin-top:25px; " value="http://www.baidu.com.cn/" />
    <input type="button" id="submit" value="提交" />
    </form>
    </div>
    <div id="top2">

    </div> 
    <div id="top3">
    <!--  <h4>树形折叠</h4>
    <ul id="browser" class="filetree">
    <li><span class="folder">html </span>
    <ul>
    <li><span class="folder">head</span>
    <ul>
    <li><span class="file">title</span></li>
    <li><span class="file"></span></li>
    </ul>
    </li>
    <li><span class="file">/head</span></li>
    <li><span class="folder">&lt;body&gt;</span>
    <ul id="folder21">
    <li><span class="file">&lt;p&gt;&lt;/p&gt;</span></li>
    <li><span class="file">&lt;p&gt;&lt;/p&gt;</span></li>
    </ul>
    </li>
    <li><span class="file">&lt;/body&gt;</span></li>
    </ul>
      <li><span class="file">html&gt;</span></li>
      </li>
    </ul>-->
    </div>
    </div>
    <div id="down"></div>
    </div>
    <div id="right">
    <div style="width:370px; height:380px; position:relative; border-bottom:ridge">
    <table width="372" border="0">
    <tr><td height="40px" colspan="2"></td></tr>
    <tr><td height="160" colspan="2">
      <table width="316" height="47" border="0">
        <tr>
          <td width="66" height="43">网址:</td>
          <td width="240">
      <form id="form1" name="form1" method="post" action="">
      <label>
      <input type="text" name="text" id="url"  style="width:200px; font-style:inherit; margin-top:25px; " value="http://www.baidu.com.cn/"/>
      </label>
                </form></td>
        </tr>
      </table>
    </td>
    <td><input name="submit" id="ok" type="button" value="提交" /></td>
    </tr>
    <tr><td width="74" height="36">
    匹配准则:
    </td>
      <td width="217">
      <select id="select" style="width:200px; height:30px;">
      </select></td>
    <td><form id="form2" name="form2" method="post" action="">
    <input  type="button"id="choose" value="确定" />
    </form></td>
    </tr>
    <tr><td height="38" colspan="2"><input  id="context" name="context" type="text" style="width:300px; height:30px;" /></td>
      <td><input id="sure" name="button" type="button" value="确定" /></td>
    </tr>
      <tr>
        <td colspan="2"></td>
        <td width="67"></td>
      </tr>
    </table></div>
    <div style="width:370px; height:400px; border-top:ridge">
    <iframe align="middle" src="" width="380px" height="399px"></iframe>
    </div>
    </div>
    </div>
    </body>
    </html>
      

  4.   

    dfdd