javascript实现操作cookie实现的可记忆菜单
可记忆菜单
body {font:12px Tahoma, sans-serif;color:#4D4D4D;margin:0px; text-align:center}
a{color:#4D4D4D;text-decoration:none}
a:hover{color:#AD0000;text-decoration:none}
#menu {width:160px;margin:0px;padding:0px;text-align:left;list-style:none;border:1px solid #B0D4ED}
#menu .item {margin:0px;padding:0px;list-style:none; text-align:center}
a.title:link,a.title:visited,a.title:hover {display:block;height:30px;line-height:30px; margin-top:1px;background:#E1F2FD;border-top:1px solid #B0D4ED;border-bottom:1px solid #B0D4ED;font-weight:bold;}
#menu .item ul {margin:0;list-style:none;display:none;text-align:center}
#menu .item ul li {height:24px;line-height:22px;border-bottom:1px solid #BFDBEE;margin:0 20px}
// --- 获取ClassName
document.getElementsByClassName = function(cl) {
var retnode = [];
var myclass = new RegExp('\\b'+cl+'\\b');
var elem = this.getElementsByTagName('*');
for (var j = 0; j 0) {
var date = new Date();
date.setTime(date.getTime + expireHours * 3600 * 1000);
cookieString = cookieString + "; expire=" + date.toGMTString();
}
document.cookie = cookieString;
}
//--- 获取cookie
function getCookie(sName) {
var aCookie = document.cookie.split("; ");
for (var j=0; j
- 菜单选项一
- 子菜单一
- 子菜单二
- 子菜单三
- 子菜单四
- 菜单选项二
- 子菜单一
- 子菜单二
- 子菜单三
- 子菜单四
- 菜单选项三
- 子菜单一
- 子菜单二
- 子菜单三
- 子菜单四
- 菜单选项四
- 子菜单一
- 子菜单二
- 子菜单三
- 子菜单四
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]