静态树的写法
1 2 3 | < script src = "../lib/jquery.js" type = "text/javascript" ></ script > < script src = "../lib/jquery.cookie.js" type = "text/javascript" ></ script > < script src = "../jquery.treeview.js" type = "text/javascript" ></ script > |
1 2 3 4 5 6 7 8 9 10 | <script type= "text/javascript" > $(document).ready( function (){ $( "#navigation" ).treeview({ persist: "location" , collapsed: true , unique: true }); }); </script> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | < ul id = "navigation" > < li >< a href = "?1" >Item 1</ a > < ul > < li >< a href = "?1.0" >Item 1.0</ a > < ul > < li >< a href = "?1.0.0" >Item 1.0.0</ a ></ li > </ ul > </ li > < li >< a href = "?1.1" >Item 1.1</ a ></ li > < li >< a href = "?1.2" >Item 1.2</ a > < ul > < li >< a href = "?1.2.0" >Item 1.2.0</ a > < ul > < li >< a href = "?1.2.0.0" >Item 1.2.0.0</ a ></ li > < li >< a href = "?1.2.0.1" >Item 1.2.0.1</ a ></ li > < li >< a href = "?1.2.0.2" >Item 1.2.0.2</ a ></ li > </ ul > </ li > < li >< a href = "?1.2.1" >Item 1.2.1</ a > < ul > < li >< a href = "?1.2.1.0" >Item 1.2.1.0</ a ></ li > </ ul > </ li > < li >< a href = "?1.2.2" >Item 1.2.2</ a > < ul > < li >< a href = "?1.2.2.0" >Item 1.2.2.0</ a ></ li > < li >< a href = "?1.2.2.1" >Item 1.2.2.1</ a ></ li > < li >< a href = "?1.2.2.2" >Item 1.2.2.2</ a ></ li > </ ul > </ li > </ ul > </ li > </ ul > </ li > < li >< a href = "?2" >Item 2</ a > < ul > < li >< span >Item 2.0</ span > < ul > < li >< a href = "?2.0.0" >Item 2.0.0</ a > < ul > < li >< a href = "?2.0.0.0" >Item 2.0.0.0</ a ></ li > < li >< a href = "?2.0.0.1" >Item 2.0.0.1</ a ></ li > </ ul > </ li > </ ul > </ li > < li >< a href = "?2.1" >Item 2.1</ a > < ul > < li >< a href = "?2.1.0" >Item 2.1.0</ a > < ul > < li >< a href = "?2.1.0.0" >Item 2.1.0.0</ a ></ li > </ ul > </ li > < li >< a href = "?2.1.1" >Item 2.1.1</ a > < ul > < li >< a href = "?2.1.1.0abc" >Item 2.1.1.0</ a ></ li > < li >< a href = "?2.1.1.1" >Item 2.1.1.1</ a ></ li > < li >< a href = "?2.1.1.2" >Item 2.1.1.2</ a ></ li > </ ul > </ li > < li >< a href = "?2.1.2" >Item 2.1.2</ a > < ul > < li >< a href = "?2.1.2.0" >Item 2.1.2.0</ a ></ li > < li >< a href = "?2.1.2.1" >Item 2.1.2.1</ a ></ li > < li >< a href = "?2.1.2.2" >Item 2.1.2.2</ a ></ li > </ ul > </ li > </ ul > </ li > </ ul > </ li > < li >< a href = "?3" >Item 3</ a > < ul > < li class = "open" >< a href = "?3.0" >Item 3.0</ a > < ul > < li >< a href = "?3.0.0" >Item 3.0.0</ a ></ li > < li >< a href = "?3.0.1" >Item 3.0.1</ a > < ul > < li >< a href = "?3.0.1.0" >Item 3.0.1.0</ a ></ li > < li >< a href = "?3.0.1.1" >Item 3.0.1.1</ a ></ li > </ ul > </ li > < li >< a href = "?3.0.2" >Item 3.0.2</ a > < ul > < li >< a href = "?3.0.2.0" >Item 3.0.2.0</ a ></ li > < li >< a href = "?3.0.2.1" >Item 3.0.2.1</ a ></ li > < li >< a href = "?3.0.2.2" >Item 3.0.2.2</ a ></ li > </ ul > </ li > </ ul > </ li > </ ul > </ li > </ ul > |
==============以下代码由 莫·名 提供===============
1 | < ul id = "navigation" class = "filetree" ></ ul > |
1 2 3 4 5 6 7 | $( function () { $( "#navigation" ).treeview({ url: "/init/leftmenu?path=\/" , collapsed: true , unique: true }); }); |
这样就可以请求服务器上的数据了
特别申明:
本站所有资源都是由网友投稿发布,或转载各大下载站,请自行检测软件的完整性!
本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!
如有侵权请联系我们删除下架,联系方式:lei1294551502@163.com