如果是感应触发.就选onmouseover
如果是点击触发.就选onclick [把它们两互相替换,就可随时变为感应或点击了]
而如果想在一个页面上有n个滑动门
就复制一套...将mytab0改成mytab1 mytab2 mytab3 等等等..都可以..或者换成你自己喜欢的名字...当然mytab0_content0这个亦是要随着变动!
保留自己用
body{
color: #000;
font-family: "宋体", arial;
font-size: 12px;
background: #fff;
text-align: center;
margin: 0;
}
.ntab{
float: left;
width: 960px;
margin: 0 auto;
border-bottom:1px #aaccee solid;
background:#d5d5d5;
background-position:left;
background-repeat:repeat-y;
margin-bottom:2px;
}
.ntab .tabtitle{
clear: both;
height: 22px;
overflow: hidden;
}
.ntab .tabtitle ul{
border:0;
margin:0;
padding:0;
}
.ntab .tabtitle li{
float: left;
width: 70px;
cursor: pointer;
padding-top: 4px;
padding-right: 0px;
padding-left: 0px;
padding-bottom: 2px;
list-style-type: none;
}
.ntab .tabtitle .active{background:#fff;border-left:1px #aaccee solid;border-top:1px #aaccee solid;border-right:1px #aaccee solid;border-bottom:1px #fff solid;}
.ntab .tabtitle .normal{background:#ebf3fb;border:1px #aaccee solid;}
.ntab .tabcontent{
width:auto;background:#fff;
margin: 0px auto;
padding:10px 0 0 0;
border-right:1px #aaccee solid;border-left:1px #aaccee solid;
}
.none {display:none;}
function ntabs(thisobj,num){
if(thisobj.classname == "active")return;
var tabobj = thisobj.parentnode.id;
var tablist = document.getelementbyid(tabobj).getelementsbytagname("li");
for(i=0; i <tablist.length; i++)
{
if (i == num)
{
thisobj.classname = "active";
document.getelementbyid(tabobj+"_content"+i).style.display = "block";
}else{
tablist[i].classname = "normal";
document.getelementbyid(tabobj+"_content"+i).style.display = "none";
}
}
}
- 全部
- 日志
- 咨询
- 相册
- 商城
- 社区
000
111
222
333
444
555
- aaa
- bbb
- ccc
- 单击
000
111
222
333
[ctrl+a 全选 注:如需引入外部js需刷新才能执行]