163.com的tab效果

本文介绍了一种使用JavaScript实现的网页标签切换效果,通过简单的HTML结构配合JavaScript代码,可以轻松地为网页添加交互性的标签切换功能,使得用户能够方便地在不同的内容区块之间进行切换。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<!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>JS01</title>
<style type="text/css">
body{font-size:12px; text-align:center; line-height:18px;}
.tabs{width:400px; margin:auto;}
.tabs_title{width:400px; height:24px; border-bottom:#788 solid 3px;}
.tabs_title_01{width:76px; height:18px; padding-top:6px; float:left; background:url(http://www.singercn.net/my/js01/bg_01.gif) no-repeat; cursor:hand;}
.tabs_title_02{width:76px; height:18px; padding-top:6px; float:left; background:url(http://www.singercn.net/my/js01/bg_02.gif) no-repeat; cursor:hand;}
.tabs_title_03{width:3px; height:24px; overflow:hidden; float:left;}
.tabs_content{width:400px;}
</style>
</head>

<body>
<SCRIPT language=JavaScript> 
var tID=0;
function showTabs(ID){
  if(ID!=tID){
    TabTitle[tID].className='tabs_title_01';
    TabTitle[ID].className='tabs_title_02';
    TabContent[tID].style.display='none';
    TabContent[ID].style.display='';
    tID=ID;
  }
}
</SCRIPT>
<div class="tabs">
  <div class="tabs_title">
    <div class="tabs_title_02" id="TabTitle" οnclick="showTabs(0)">网站电视</div>
<div class="tabs_title_03"></div>
    <div class="tabs_title_01" id="TabTitle" οnclick="showTabs(1)">免费电影</div>
<div class="tabs_title_03"></div>
    <div class="tabs_title_01" id="TabTitle" οnclick="showTabs(2)">电视剧集</div>
<div class="tabs_title_03"></div>
    <div class="tabs_title_01" id="TabTitle" οnclick="showTabs(3)">精彩视频</div>
  </div>
  <div class="tabs_content" id="TabContent" style="display:block;">网站电视内容</div>
  <div class="tabs_content" id="TabContent" style="display:none;">免费电影内容</div>
  <div class="tabs_content" id="TabContent" style="display:none;">电视剧集内容</div>
  <div class="tabs_content" id="TabContent" style="display:none;">精彩视频内容</div>
</div>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值