>
设为首页
>
收藏本站
>
最新电影
首页
运营资讯
今日英语
图形图像
计算机技术
Asp编程
网站结构化
资源共享
休闲娱乐
访问新站
您现在的位置:
首页
=>
后台技术
=>
脚本特效
=>
菜单导航
订阅本栏目
非常酷的菜单管理效果
时间: 2008-07-10 23:40:11 阅读次数:3316
<!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> <style type="text/css"> body{font-size:12px;} ul,li,h2{margin:0;padding:0;} ul{list-style:none;} #top{width:900px;height:40px;margin:0 auto;background-color:#CCCC00} #top h2{width:150px;height:40px;background-color:#99CC00;float:left;font-size:14px;text-align:center;line-height:40px;} #topTags{width:750px;height:40px;margin:0 auto;background-color:#CCCC00;float:left} #topTags ul li{float:left;width:100px;height:25px;margin-right:5px;display:block;text-align:center;cursor:pointer;padding-top:15px;} #main{width:900px;height:500px;margin:0 auto;background-color:#F5F7E6;} #leftMenu{width:150px;height:500px;background-color:#009900;float:left} #leftMenu ul{margin:10px;} #leftMenu ul li{width:130px;height:30px;display:block;background:#99CC00;cursor:pointer;line-height:30px;text-align:center;margin-bottom:5px;} #leftMenu ul li a{color:#000000;text-decoration:none;} #content{width:750px;height:500px;float:left} .content{width:740px;height:490px;display:none;padding:5px;overflow-y:auto;line-height:30px;} #footer{width:900px;height:30px;margin:0 auto;background-color:#ccc;line-height:30px;text-align:center;} .content1 {width:740px;height:490px;display:block;padding:5px;overflow-y:auto;line-height:30px;} </style> <script type="text/javascript"> window.onload=function(){ function $(id){return document.getElementById(id)} var menu=$("topTags").getElementsByTagName("ul")[0];//顶部菜单容器 var tags=menu.getElementsByTagName("li");//顶部菜单 var ck=$("leftMenu").getElementsByTagName("ul")[0].getElementsByTagName("li");//左侧菜单 var j; //点击左侧菜单增加新标签 for(i=0;i<ck.length;i++){ ck[i].onclick=function(){ $("welcome").style.display="none"//欢迎内容隐藏 //循环取得当前索引 for(j=0;j<8;j++){ if(this==ck[j]){ if($("p"+j)==null){ openNew(j,this.innerHTML);//设置标签显示文字 } clearStyle(); $("p"+j).style.backgroundColor="yellow"; clearContent(); $("c"+j).style.display="block"; } } return false; } } //增加或删除标签 function openNew(id,name){ var tagMenu=document.createElement("li"); tagMenu.id="p"+id; tagMenu.innerHTML=name+" "+"<img src='http://www.tjdadi.com.cn/off.gif' style='vertical-align:middle'/>"; //标签点击事件 tagMenu.onclick=function(evt){ clearStyle(); tagMenu.style.backgroundColor="yellow"; clearContent(); $("c"+id).style.display="block"; } //标签内关闭图片点击事件 tagMenu.getElementsByTagName("img")[0].onclick=function(evt){ evt=(evt)?evt:((window.event)?window.event:null); if(evt.stopPropagation){evt.stopPropagation()} //取消opera和Safari冒泡行为; this.parentNode.parentNode.removeChild(tagMenu);//删除当前标签 var color=tagMenu.style.backgroundColor; //设置如果关闭一个标签时,让最后一个标签得到焦点 if(color=="#ffff00"||color=="yellow"){//区别浏览器对颜色解释 if(tags.length-1>=0){ clearStyle(); tags[tags.length-1].style.backgroundColor="yellow"; clearContent(); var cc=tags[tags.length-1].id.split("p"); $("c"+cc[1]).style.display="block"; } else{ clearContent(); $("welcome").style.display="block" } } } menu.appendChild(tagMenu); } //清除标签样式 function clearStyle(){ for(i=0;i<tags.length;i++){ menu.getElementsByTagName("li")[i].style.backgroundColor="#FFCC00"; } } //清除内容 function clearContent(){ for(i=0;i<7;i++){ $("c"+i).style.display="none"; } } } </script> </head> <body> <div id="top"> <h2>管理菜单</h2> <div id="topTags"> <ul> </ul> </div> </div> <div id="main"> <div id="leftMenu"> <ul> <li>个人资料</li> <li>相册管理</li> <li>日志管理</li> <li>留言管理</li> <li>风格管理</li> <li>系统管理</li> <li>帮助信息</li> <li>再加一个</li> </ul> </div> <div id="content"> <div id="welcome" class="content" style="display:block;"> <div align="center"> <p> </p> <p><strong>欢迎使用用户管理系统!</strong></p> <p> </p> </div> </div> <div id="c0" class="content">个人资料</div> <div id="c1" class="content">相册管理</div> <div id="c2" class="content">日志管理</div> <div id="c3" class="content">留言管理</div> <div id="c4" class="content">风格管理</div> <div id="c5" class="content">系统管理</div> <div id="c6" class="content">帮助信息</div> </div> </div> <div id="footer">copyright for lalasxc </div> </body> </html>
提示:您可以先修改部分代码再运行
飞飞Asp技术乐,园
站内搜索
:
标题
内容
下一篇
同一个页面可以多次使用的选项卡
上一篇
可以拖动的菜单
本栏目最新
栏目最新列表
使用jquery实现的简单下拉菜单(下拉框)效
简单的下拉菜单效果
div+css能在ie7/ie7/Firefox下运行的菜单导
同一个页面可以多次使用的选项卡
非常酷的菜单管理效果
网站优化策划
栏目最新列表
增加网站外链的快速方法
网站上线前必做的30个检查
新的友情链接参考标准(没有google的PR情况
优化Google的AdSense广告的五个工具
王通讲SEO八大基础
站点最新
站点最新列表
微博推广的一些技巧
xhEditor v1.1.7 发布,
收集的一些轻量级非常实
50个新鲜兼容最新版本的
javascript中cookie的设
Excel中出现#VALUE!、#D
jquery插件:飞飞表情插件
十个使用HTML5开发的精彩
支持HTML5的浏览器有哪些
飞妮莫属:漫画:如何写出
历史最热10条信息
MIME介绍 及
[
1
] [
2
] [
3
]
巧用Google和迅雷来下载
Transact SQL 常
[
1
] [
2
]
VIA Rhine II Fast Ethe
电脑常用端
[
1
] [
2
] [
3
]
Do you get a kick out
十道羊皮卷 欣赏+mp3版+
每日一句:A friend and
每日一句:Theres no tu
经典__悟透JavaScript
伟哥博客
西安房产
123最新电影
三四六四
关于站点
|
免责声明
|
联系站长
|
网站地图
|
陕ICP备07002804号
WEB技术QQ交流群:72840059
©2007 ffasp.com. 版权所有