NAME:StupidCATPull-downMenuv1.0
SUPPORT:Ie(√)Firefox(√)
STANDARD:XHTML1.0Strict/CSS2.0
核心样式:
复制代码 代码如下:
html,body{
background:#000000;
height:100%;
font-size:12px;
font-family:Arial,Helvetica,sans-serif;
color:#333333;
margin:20pxauto;
overflow:hidden;
text-align:center;}
/*菜单容器menu*/
div#menu{
width:100%;
height:34px;
padding:0px0px0px5px;}
/*一级菜单*/
div#menudiv{
width:125px;
height:20px;
float:left;
text-transform:capitalize;
background:#cccccc;
padding:5px0px0px0px;
margin:4px1px0px0px;}
/*二级菜单*/
div#menudivdiv{
width:125px;
height:20px;
border-bottom:1px#333333solid;
background:#666666;
margin-top:-4px;
cursor:pointer;
display:none;}
/*二级菜单中特殊样式(可选)*/
div#menudivdiv.div1{
margin-top:3px;
border-top:1px#333333solid;}
核心代码:
复制代码 代码如下:
varmenuItem=document.getElementById("menu").getElementsByTagName("div");
for(i=0;i
varsubMenu=this.getElementsByTagName("div");
for(j=0;j
subMenu[j].onmouseover=function(){this.style.background="#999999";this.style.color="#000000";};
subMenu[j].onmouseout=function(){this.style.background="#666666";this.style.color="#333333";};}
this.style.background="#666666"};
menuItem[i].onmouseout=function(){
varsubMenu=this.getElementsByTagName("div");
for(j=0;j
this.style.background="#cccccc"};
}
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]