notice

致江湖上的朋友:
  欢迎您访问╃苍狼山庄╃请使用侧边栏的搜索功能查找日志,希望能在这里找到您所需要的东西,使您在平淡之中充满喜悦。

Clang 出品,必属精品! 我的地盘我做主! 活着,真累!
本站域名:Http://ClangCN.Com/(点击加入收藏夹)
欢迎您再来,谢谢!!!
Clang 于2006年01月09日

Tab标签选项卡和滑动门菜单(CSS+JS)

2010年3月28日 | 分类: 程序代码 | 标签: , , , ,

兼容IE7、IE8、FF等主流浏览器的多标签选项卡和滑动门菜单,基于CSS+JS技术实现,简洁漂亮,千万不要错过,用到一张背景图片,您可以自行下载到本地,本选项卡是大网站扒下的,而且好多网站都有用过,绝对值得收藏的一款点触式滑动门。
预览:
tab_biaoqianxuanxiangka.html
huadongmen.html

Tab标签选项卡

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!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-family: arial;
font-size: 12px;
text-align: center;
margin: 0;
}
.nTab{
float: left;
width: 542px;
margin: 0 auto;
border-bottom:1px #C7C7CD solid;
background:#d5d5d5;
background-position:left;
background-repeat:repeat-y;
margin-bottom:2px;
}
.nTab .TabTitle{
clear: both;
height: 26px;
overflow: hidden;
}
.nTab .TabTitle ul{
margin:0;
padding:0;
}
.nTab .TabTitle li{
float: left;
width: 60px;
cursor: pointer;
padding-top: 6px;
padding-right: 0px;
padding-left: 0px;
padding-bottom: 7px;
list-style-type: none;
}
.nTab .TabTitle .active{ background:url(images/tab_bg1.gif) left -25px no-repeat;border-left:1px  #C7C7CD solid;border-top:1px  #C7C7CD solid;border-bottom:1px #fff solid;}
.nTab .TabTitle .normal{ background:url(images/tab_bg1.gif);border-top:1px #C7C7CD solid;border-bottom:1px #C7C7CD solid;}
.nTab .TabContent{
width:auto;background:#fff;
margin: 0px auto;
padding:10px 0 0 0;
border-right:1px #C7C7CD solid;border-left:1px #C7C7CD solid;
}
.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>
<br />
<br />
<center>
<div style="text-align:center; margin-left:200px;">
<!-- 选项卡开始 -->
  <div class="nTab">
    <!-- 标题开始 -->
    <div class="TabTitle">
      <ul id="myTab0">
        <li class="active" onclick="nTabs(this,0);">首页</li>
        <li class="normal" onclick="nTabs(this,1);">博客</li>
        <li class="normal" onclick="nTabs(this,2);">下载</li>
        <li class="normal" onclick="nTabs(this,3);">源码</li>
        <li class="normal" onclick="nTabs(this,4);">视频</li>
      </ul>
    </div>
    <!-- 内容开始 -->
    <div class="TabContent">
      <div id="myTab0_Content0"> 出自:<a href="http://www.clangcn.com/">╃苍狼山庄╃</a></div>
      <div id="myTab0_Content1" class="none"><a href="http://clangcn.com/blog">╃苍狼山庄╃博客</a></div>
      <div id="myTab0_Content2" class="none"><a href="http://www.clangcn.com/clang/down">╃苍狼山庄╃下载</a></div>
      <div id="myTab0_Content3" class="none"><a href="http://www.clangcn.com/">╃苍狼山庄╃源码</a></div>
      <div id="myTab0_Content4" class="none"><a href="http://www.clangcn.com/">╃苍狼山庄╃视频</a></div>
    </div>
  </div>
  <!-- 选项卡结束 -->
</div>
</center>
</body>
</html>

滑动门菜单

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!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>兼容IE7 IE8 FF 等主流浏览器多标签滑动门 - ╃苍狼山庄╃</title>
<style type="text/css">
body{
color: #000;
font-family: "宋体", arial;
font-size: 12px;
background: #fff;
text-align: center;
margin: 0;
}
.nTab{
float: left;
width: 542px;
margin: 0 auto;
border-bottom:1px #C7C7CD solid;
background:#d5d5d5;
background-position:left;
background-repeat:repeat-y;
margin-bottom:2px;
}
.nTab .TabTitle{
clear: both;
height: 26px;
overflow: hidden;
}
.nTab .TabTitle ul{
margin:0;
padding:0;
}
.nTab .TabTitle li{
float: left;
width: 60px;
cursor: pointer;
padding-top: 6px;
padding-right: 0px;
padding-left: 0px;
padding-bottom: 7px;
list-style-type: none;
}
.nTab .TabTitle .active{ background:url(images/tab_bg1.gif) left -25px no-repeat;border-left:1px  #C7C7CD solid;border-top:1px  #C7C7CD solid;border-bottom:1px #fff solid;}
.nTab .TabTitle .normal{ background:url(images/tab_bg1.gif);border-top:1px #C7C7CD solid;border-bottom:1px #C7C7CD solid;}
.nTab .TabContent{
width:auto;background:#fff;
margin: 0px auto;
padding:10px 0 0 0;
border-right:1px #C7C7CD solid;border-left:1px #C7C7CD solid;
}
.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>
<br />
<br />
<center>
<div style="text-align:center; margin-left:200px;">
<!-- 选项卡开始 -->
  <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>
        <li class="normal" onmouseover="nTabs(this,3);">源码</li>
        <li class="normal" onmouseover="nTabs(this,4);">视频</li>
      </ul>
    </div>
    <!-- 内容开始 -->
    <div class="TabContent">
      <div id="myTab0_Content0"> 出自:<a href="http://www.clangcn.com/">╃苍狼山庄╃</a></div>
      <div id="myTab0_Content1" class="none"><a href="http://clangcn.com/blog">╃苍狼山庄╃博客</a></div>
      <div id="myTab0_Content2" class="none"><a href="http://www.clangcn.com/clang/down">╃苍狼山庄╃下载</a></div>
      <div id="myTab0_Content3" class="none"><a href="http://www.clangcn.com/">╃苍狼山庄╃源码</a></div>
      <div id="myTab0_Content4" class="none"><a href="http://www.clangcn.com/">╃苍狼山庄╃视频</a></div>
    </div>
  </div>
  <!-- 选项卡结束 -->
</div>
</center>
</body>
</html>

-------------------------End-------------------------

本文的评论功能被关闭了.