javascript做导航条
2015-11-01 16:30
567 查看
站长之家导航特效 - 妙味课堂 - www.miaov.com
window.onload=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
}
}
/* background: red;*/
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
.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的设置结束=====
window.onload=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
nav{
width:500px; height:36px; padding:0 10px; background: url(images/nav_bg.gif) repeat-x; margin: 50px auto 0; position: relative; /*background: pink;*/
}
nav .adorn1{
width: 6px; height: 36px; background: url(iamges/nav_bg.gif) no-repeat 0 -36px; position:absolute; top: 0; left: 0; /*background: red;*/
}
nav .adorn2{
width:6px; height: 36px; background: url(images/nav_bg.gif) no-repeat 0 -72px; position: absolute; top: 0; right: 0;
/* background: red;*/
}
nav li{
float: left; height: 36px; padding:0 3px 0 7px; position: relative; cursor: pointer;
}
nav .line {
background: url(images/active_bg.gif) no-repeat 0 -90px;}
nav .active {
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;
}
nav .active span{
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;
}
nav .normal {
float: left; height: 36px; line-height: 36px; font-size: 14px; text-decoration: none; color: #fff;
}
nav .normal span {
float: left; height: 36px; padding: 0 20px;
}
nav .normal:hover {
background: url(images/active_bg.gif) no-repeat right -40px;
}
nav .normal:hover span {
background: url(images/active_bg.gif) no-repeat 0 5px;
}
nav .float_layer{
height: 27px; color: #235e99; padding: 0 10px; background: url(images/nav_bg.gif) repeat-x 0 -162px; position: absolute; top: 40px; display: none;
}
nav .arrows{
width: 7px; height: 5px; overflow: hidden; background: url(iamges/active_bg.gif) no-repeat 0 -190px; position: absolute; top: -4px;
}
nav .decorate1{
width: 6px; height: 27px; background: url(images/nav_bg.gif) no-repeat 0 -108px; position: absolute; top: 0; left: -6px;
}
nav .decorate2{
width: 6px; height: 27px; background: url(images/nav_bg.gif) no-repeat 0 -135px; position: absolute; top: 0; right: -6px;
}
nav .float_layer a{
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;
}
nav .float_layer a span{
float: left; height: 18px; padding-top: 3px; overflow: hidden; border-bottom: 2px solid #cedce8;
}
nav .float_layer a:hover span{
border-bottom: 2px solid #235e99;
}
nav p{
position: absolute; top:10px; right: 20px;
}
nav p a{
color: #fff; font-size: 14px; text-decoration: none;
}
nav p a:hover{
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的设置结束=====
相关文章推荐
- JQuery1——基础($对象,选择器,对象转换)
- Android学习笔记(二九):嵌入浏览器
- Android java 与 javascript互访(相互调用)的方法例子
- JavaScript演示排序算法
- javascript实现10进制转为N进制数
- 2019年开发人员应该学习的8个JavaScript框架
- HTML中的script标签研究
- 对一个分号引发的错误研究
- 异步流程控制:7 行代码学会 co 模块
- ES6 走马观花(ECMAScript2015 新特性)
- JavaScript拆分字符串时产生空字符的原因
- Canvas 在高清屏下绘制图片变模糊的解决方法
- IE8开发人员工具教程(二)
- 在flex中执行一个javascript方法的简单方式
- Flex结合JavaScript读取本地路径的方法
- PowerShell中执行Javascript的方法示例
- javascript asp教程第六课-- response方法
- javascript asp教程More About Recordsets