当前位置:编程学习 > JS >>

某一选项不被激活的滑动门(实用)代码

某一选项不需被激活的滑动门(实用)代码,也主浊某一滑动门单元可以不滑动,而安排另有它用,比如第一个和第四个单元就是有其它的用处,第一个是不能被激活的,显示的内容是固定的,第四个“更多”是一个文字链接,将用户指引到其它地方,可以不完成没去门的功能。
答案:<!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: 9pt;
background: #fff;
text-align: center;
margin: 0;
}
.wrap{
width:360px;
margin:100px auto;
position:relative;
border:1px #AACCEE solid;
border-top-width:0px;
}
.wrap .them
          {border-top:1px #AACCEE solid;
	border-bottom:1px #AACCEE solid;
          width:72px;
	 height:20px;
	  line-height:20px;
	  position:absolute;
	  left:0px;
	  top:0px;
	  background:#EBF3FB;
	  text-align:center;
	  font-weight:bold;
	  z-index:1px;}
.wrap .more
          {border-top:1px #AACCEE solid;
	  border-bottom:1px #AACCEE solid;
          width:72px;
	  height:20px;
	  line-height:20px;
	  position:absolute;
	  right:0px;
	  top:0px;
	  background:#EBF3FB;
	  text-align:center;
	  font-weight:bold;
	  z-index:1px;}
            
.nTab{
margin:0 auto;
margin: 0 auto;
background-position:left;
background-repeat:repeat-y;
margin-bottom:2px;
}
.nTab .TabTitle{
width:216px;
margin:0 auto;
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;
line-height:24px;
}
.none {display:none;}
</style>
<script type="text/javascript">
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";
  }
} 
}
</script>
</head>
<body>
<div class="wrap">
 <div class="them">最新</div>
<!-- 选项卡0开始 -->
 <div class="nTab">
    <!-- 标题开始 -->
    <div class="TabTitle">
      <ul id="myTab0">
        <li class="active" onmouseover="nTabs(this,0);">排行</li>
        <li class="normal" onmouseover="nTabs(this,1);">关于</li>
        <li class="normal" onmouseover="nTabs(this,2);">广告</li>
       </ul>
    </div>
    <!-- 内容开始 -->
    <div class="TabContent">
      <div id="myTab0_Content0">下载排行!</div>
      <div id="myTab0_Content1" class="none">编程资源、书籍、网页特效。</div>
      <div id="myTab0_Content2" class="none">如果你是软件开发商或IDC运营商,请联系我们。</div>
      
    </div>
  </div> 
  <!-- 选项卡0结束 -->
   <div class="more"><a href="/">更多>></a></div>
  </div>
</body>
</html>

上一个:CSS相对定位实现DIV层的投影(阴影)效果
下一个:Js拖动层代码

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,