|
效果一: 代码一: 效果二: 代码二: -
- <!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 media="screen" type="text/css">
- <!--
- *{font-size:12px;}
- html,body{margin:0;text-align:center;over-flow:hidden;height:100%;width:100%;}
- UL{list-style-type:none; margin:0px;}
- /* 标准盒模型 */
- .ttl{height:18px;}
- .ctt{height:auto;padding:6px;clear:both;border:1px solid #064ca1;border-top:0;text-align:left;}
- .w936{margin:2px 0;clear:both;width:936px;/*这里调整整个滑动门的宽度*/}
- /* TAB 切换效果 */
- .tb_{background-image: url('/upload/remot2008/20083675856621.gif'); background-repeat: repeat-x;background-color: #E6F2FF;}
- .tb_ ul{height:24px;}
- .tb_ li{float:left;height: 24px;line-height:1.9;width: 94px;cursor:pointer;}
- /* 用于控制显示与隐藏的css类 */
- .normaltab { background-image:url('/upload/remot2008/20083675857803.gif'); background-repeat: no-repeat; color:#1F3A87 ;}
- .hovertab { background-image: url('/upload/remot2008/20083675857471.gif'); background-repeat: no-repeat; color:#1F3A87; font-weight:bold }
- .dis{display:block;}
- .undis{display:none;}
- -->
- </style>
- <script type="text/javascript" language="javascript">
- //<!CDATA[
- function g(o){return document.getElementById(o);}
- function HoverLi(n){
- //如果有N个标签,就将i<=N;
- for(var i=1;i<=6;i++){g('tb_'+i).className='normaltab';g('tbc_0'+i).className='undis';}g('tbc_0'+n).className='dis';g('tb_'+n).className='hovertab';
- }
- //如果要做成点击后再转到请将<li>中的onmouseover 改成 onclick;
- //]]>
- </script>
- </head>
- <body>
- <div class="w936">
- <div id="tb_" class="tb_">
- <ul>
- <li id="tb_1" class="hovertab" onmouseover="x:HoverLi(1);">
- 流行音乐</li>
- <li id="tb_2" class="normaltab" onmouseover="i:HoverLi(2);">
- 美女写真</li>
- <li id="tb_3" class="normaltab" onmouseover="a:HoverLi(3);">
- 平面设计</li>
- <li id="tb_4" class="normaltab" onmouseover="o:HoverLi(4);">
- 网络学堂</li>
- <li id="tb_5" class="normaltab" onmouseover="g:HoverLi(5);">
- 恋爱宝典</li>
- <li id="tb_6" class="normaltab" onmouseover="z:HoverLi(6);">
- 栏目文章</li>
- </ul>
- </div>
- <div class="ctt">
- <div class="dis" id="tbc_01">流行音乐 的内容</div>
- <div class="undis" id="tbc_02">美女写真 的内容</div>
- <div class="undis" id="tbc_03">平面设计 的内容</div>
- <div class="undis" id="tbc_04">网络学堂 的内容</div>
- <div class="undis" id="tbc_05">恋爱宝典 的内容</div>
- <div class="undis" id="tbc_06">栏目文章 的内容</div>
- </div>
- </div>
- </body>
- </html>
[/i][/i] 效果三: 代码三: - <!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>
- <title>选项卡</title>
- <style type="text/css">
- <!--
- h1,h2,h3,h4,h5,h6,form{
- margin:0;
- padding:0;
- }
- #indexColumn{
- padding-bottom:2px;
- margin-bottom:0;
- border:#739FCB 1px solid;
- width:500px;
- }
- .centerColumnContent{
- clear:both;
- }
- /***选项卡*/
- .columnBar{
- /*兼容IE和Firefox*/
- width:500px!important;
- width:498px;
- padding-left:1px!important;
- padding:0 0 0 3px;
- margin:0 0 8px 0;
- list-style:none;
- float:left;
- background:url(/upload/remot2008/2008249626933.gif) repeat-x #FFF;
- line-height:25px;
- border-bottom:1px solid #739FCB;
- }
- .columnBar li{
- padding:0 16px 0 15px;
- float:left;
- cursor:pointer;
- background:url(/upload/remot2008/2008249626283.gif) no-repeat right center;
- }
- .columnBar li h3{
- color:#005295;
- font-size:14px;
- font-weight:normal;
- }
- /****选项卡高亮状态*/
- .columnBarOver{
- position:relative;
- margin:-1px 0 -1px -2px;
- padding:2px 14px 0 15px!important;
- line-height:24px;
- border-style:solid;
- border-width:1px 1px 0 1px;
- border-color:#5589BE #739FCB #739FCB #739FCB;
- background:url(/upload/remot2008/2008249626695.gif) repeat-x #FFF!important;
- }
- .columnBarOver h3{
- color:#F60!important;
- font-weight:bold!important;
- }
- /***中间内容*/
- .centerColumnContent{
- clear:both;
- }
- .cloumnDisplayText{
- color:#333;
- padding:5px 0 10px;
- margin-bottom:3px!important;
- margin:0 10px 4px;
- font-size:14px;
- line-height:180%;
- background:#FAFAFA;
- border-bottom:1px dashed #CCC;
- }
- -->
- </style>
- </head>
- <script type="text/javascript">
- <!--
- //通用选项卡样式内容变换
- function selCat(name,obj,n)
- {
- for(i=1;i<=n;i++)
- {
- eval("document.getElementById('"+name+i+"').className=''");
- //隐藏变换选项卡内容
- if(name == 'n' || name == 's'){}
- else{
- eval("document.getElementById('display_"+name+'_'+i+"').style.display='none'");
- }
- }
- //排行模块
- if(name == 'mt' || name == 'dt'){
- eval("document.getElementById('"+name+obj+"').className='topButtonOver'");
- }
- //所有中间选项卡模块
- else{
- eval("document.getElementById('"+name+obj+"').className='columnBarOver'");
- }
- //显示变换选项卡内容
- if(name == 'n' || name == 's'){}
- else{
- eval("document.getElementById('display_"+name+'_'+obj+"').style.display=''");
- }
- }
- function DLLRegistered(strID)
- {
- var o = null;
- try {
- o = new ActiveXObject(strID);
- }catch(e){
- return false;
- }
- if(o != null){
- o = null;
- return true;
- }else
- return false;
- }
- -->
- </script>
- <body >
- <div id="indexColumn">
- <ul class="columnBar">
- <li id="index1" onClick="selCat('index',1,5);">
- <h3>栏目一</h3>
- </li>
- <li id="index2" onClick="selCat('index',2,5);">
- <h3>栏目二</h3>
- </li>
- <li id="index3" onClick="selCat('index',3,5);" class="columnBarOver">
- <h3>栏目三</h3>
- </li>
- <li id="index4" onClick="selCat('index',4,5);">
- <h3>栏目四</h3>
- </li>
- <li id="index5" onClick="selCat('index',5,5);">
- <h3>栏目五</h3>
- </li>
- </ul>
- <div id="indexContent" class="centerColumnContent">
- <!--栏目一-->
- <div id="display_index_1" style="display:none">
- 栏目一
- </div>
- <!--栏目二-->
- <div id="display_index_2" style="display:none">
- 栏目二
- </div>
- <!--栏目三-->
- <div id="display_index_3">
- 栏目三
- </div>
- <!--栏目四-->
- <div id="display_index_4" style="display:none">
- 栏目四
- </div>
- <!--栏目五-->
- <div id="display_index_5" style="display:none">
- <!--栏目五-->
- 栏目五
- </div>
- </div>
- </div></body>
- </html>
|