javascript做导航条

这篇博客主要介绍了如何使用JavaScript来创建和美化导航条。内容包括不同类别的样式定义,如`.active`、`.normal`和`.float_layer`,以及针对鼠标悬停效果的样式变化。还涉及到CSS定位如`.pos1`到`.pos4`,以及宽度调整 `.w1` 到 `.w4`,展示了动态导航条的交互设计。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

站长之家导航特效 - 妙味课堂 - www.miaov.com window.οnlοad=function(){ var oDiv=document.getElementById('nav'); var aLi=oDiv.getElementsByTagName('ul')[0].getElementsByTagName('li'); var aA=[]; var aSpan=[]; var oTimer=null; var i=0; for(i=0;i
width:500px;
height:36px;
padding:0 10px;
background: url(images/nav_bg.gif) repeat-x;
margin: 50px auto 0;
position: relative;
/*background: pink;*/

}

width: 6px;
height: 36px;
background: url(iamges/nav_bg.gif) no-repeat 0 -36px;
position:absolute;
top: 0;
left: 0;
/*background: red;*/

}

width:6px;
height: 36px;
background: url(images/nav_bg.gif) no-repeat 0 -72px;
position: absolute;
top: 0;
right: 0;

/* background: red;*/
}

float: left;
height: 36px;
padding:0 3px 0 7px;
position: relative;
cursor: pointer;

}

background: url(images/active_bg.gif) no-repeat 0 -90px;
}

float: left;
height: 36px;
line-height: 36px;
font-size: 14px;
text-decoration: none;
color:#fff;
background: url(images/active_bg.gif) no-repeat right -40px;

}

float: left;
height:36px;
line-height: :36px;
font-size: :14px;
padding:0 20px;
text-decoration: none;
color: #fff;
background: url(images/active_bg.gif) no-repeat 0 5px;

}

float: left;
height: 36px;
line-height: 36px;
font-size: 14px;
text-decoration: none;
color: #fff;

}

float: left;
height: 36px;
padding: 0 20px;

}

background: url(images/active_bg.gif) no-repeat right -40px; 

}

background: url(images/active_bg.gif) no-repeat 0 5px; 

}

height: 27px;
color: #235e99;
padding: 0 10px;
background: url(images/nav_bg.gif) repeat-x 0 -162px;
position: absolute;
top: 40px;
display: none;

}

width: 7px;
height: 5px;
overflow: hidden;
background: url(iamges/active_bg.gif) no-repeat 0 -190px;
position: absolute;
top: -4px;

}

width: 6px;
height: 27px;
background: url(images/nav_bg.gif) no-repeat 0 -108px;
position: absolute;
top: 0;
left: -6px;

}

width: 6px;
height: 27px;
background: url(images/nav_bg.gif) no-repeat 0 -135px;
position: absolute;
top: 0;
right: -6px;

}

float: left;
height: 27px;
line-height: 22px;
font-size: 11px;
color: #235e99;
text-decoration: none;
background: url(images/active_bg.gif) no-repeat right -207px; 
padding: 0 8px;

}

float: left;
height: 18px;
padding-top: 3px;
overflow: hidden;
border-bottom: 2px solid  #cedce8;

}

border-bottom: 2px solid #235e99;

}

position: absolute;
top:10px;
right: 20px;

}

color: #fff;
font-size: 14px;
text-decoration: none;

}

text-decoration: underline;

}
.pos1{
left: 0;
}

.pos1 .arrows{
left: 36px;
}
.w1{
width: 245px;
}

.pos2{
left: 0;
}
.pos2 .arrows{
left: 50px;
}
.w2{
width: 260px;
}

.pos3{
left: -100px;
}
.pos3 .arrows {
left: 136px;
}
.w3{
width: 230px;
}

.pos4{
left: -100px;
}
.pos4 .arrows{
left: 136px;
}
.w4{
width: 310px;
}
===============css的设置结束=====

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值