Js tree menu _ tree menu code

Source: Internet
Author: User
Tip: you can modify some code before running

<!--Modify by visc.cn for cbiw.com.cn 2007-03-19--><!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>Refresh the unchanged tree menu-js tree menu _ tree menu code</title><style type="text/css">Body, td, th {font-size: 14px ;}. leftmenu1 {font-weight: bold; cursor: hand; padding-top: 4px; height: 29px; text-align: left ;}. leftmenu2 {PADDING-LEFT: 15px; height: 21px; text-align: left;} div {margin-top: 90px; width: 100%; text-align: center ;}</style></head><body><div><script language="JavaScript" type="text/javascript">Function Show (id, I _id) {var on_img = "http://www.cbiw.com.cn/member/pic/ass04.gif"; // when opening the image var off_img = "yun_qi_img/ass03.gif"; // when hiding the image var obj = document. getElementById ('c _ '+ id); if (obj. style. display = "none") {obj. style. display = ""; I _id.src = on_img; // add the sub-menu Id to the Cookies var curShow = readCookie ('curshow '); if (curShow! = '') {Var arr_curShow = curShow. split (','); var found = false; for (I = 0; I<arr_curShow.length-1;i++) { if(arr_curShow[i].toString()==id) {found=true;} } if(!found){writeCookie('curShow',curShow+','+id,12)} } else { writeCookie('curShow',id,12) } //将子菜单Id放入Cookies End }else{ obj.style.display="none"; i_id.src=off_img; //将子菜单Id从Cookies中移除 var curShow = readCookie('curShow'); if(curShow!='') { var arr_curShow = curShow.split(','); for(i=0;i<arr_curShow.length;i++) { if(arr_curShow[i].toString()==id) {arr_curShow=arr_curShow.del(i--);} } curShow = arr_curShow.join(','); //alert(curShow); writeCookie('curShow',curShow,12) } //将子菜单Id从Cookies中移除 End }}function readCookie(name){ var cookieValue = ""; var search = name + "="; if(document.cookie.length >0) {offset = document. cookie. indexOf (search); if (offset! =-1) {offset + = search. length; end = document. cookie. indexOf (";", offset); if (end =-1) end = document. cookie. length; cookieValue = unescape (document. cookie. substring (offset, end)} return cookieValue;} function writeCookie (name, value, hours) {var expire = ""; if (hours! = Null) {expire = new Date ()). getTime () + hours * 3600000); expire = "; expires =" + expire. toGMTString ();} document. cookie = name + "=" + escape (value) + expire;} Array. prototype. del = function (n) {// n indicates the number of items, starting from 0. // Prototype is the object prototype. Note that the custom method is added for the object. If (n <0) // if n <0, no operation is performed. Return this; else return this. slice (0, n ). concat (this. slice (n + 1, this. length);} window. onload = function a () {var curShow = readCookie ('curshow'); var totalShow = 5; // you can modify the total number of second-level classes if (curShow! = ''& CurShow! = Null) {for (I = 1; I <= totalShow; I ++) {document. getElementById ('c _ '+ I ). display = "none";} var arr_curShow; arr_curShow = curShow. split (','); for (I = 0; I <= arr_curShow.length-1; I ++) {if (arr_curShow [I]! = '') {Document. getElementById ('c _ '+ arr_curShow [I]). style. display = "";}}}}</script><table width="10%" border="0" align="center" cellpadding="0" cellspacing="0"><tbody> <tr> <td class="leftmenu1">Personal data</td></tr></tbody><tbody id="c_1" ><tr> <td class="leftmenu2">Basic information</td></tr><tr> <td class="leftmenu2">Change password</td></tr></tbody><tbody> <tr> <td class="leftmenu1">My resume</td></tr></tbody><tbody id="c_2" ><tr> <td class="leftmenu2" >Resume</td></tr><tr> <td class="leftmenu2" >Job intention</td></tr><tr> <td class="leftmenu2" >Upload photo</td></tr><tr> <td class="leftmenu2" >Resume preview</td></tr></tbody><tbody> <tr> <td class="leftmenu1">Job Search</td></tr></tbody><tbody id="c_3" ><tr> <td class="leftmenu2" >Quick Search</td></tr></tbody><tbody> <tr> <td class="leftmenu1">Application Management</td></tr></tbody><tbody id="c_4" ><tr> <td class="leftmenu2" >Application records</td></tr><tr> <td class="leftmenu2" >Enterprise invitation</td></tr><tr> <td class="leftmenu2" >Add to favorites</td></tr></tbody><tbody> <tr> <td class="leftmenu1">My knowledge</td></tr></tbody><tbody id="c_5" ><tr> <td class="leftmenu2" >I want to ask</td></tr><tr> <td class="leftmenu2" >I want to answer</td></tr><tr> <td class="leftmenu2" >Question Records</td></tr><tr> <td class="leftmenu2" >Answer Records</td></tr><tr> <td class="leftmenu2" >Score Record</td></tr></tbody></table></div></body></html>
Tip: you can modify some code before running

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.