JS+CSS實(shí)現(xiàn)的經(jīng)典tab選項(xiàng)卡效果代碼
本文實(shí)例講述了JS+CSS實(shí)現(xiàn)的經(jīng)典tab選項(xiàng)卡效果代碼。分享給大家供大家參考。具體如下:
這是一款經(jīng)典的JavaScript+CSS tab選項(xiàng)卡代碼,由以前的一款改寫而成,自認(rèn)為不錯(cuò)的東西,發(fā)上來分享吧。
運(yùn)行效果截圖如下:

在線演示地址如下:
http://demo.jb51.net/js/2015/js-css-jd-tab-cha-style-codes/
具體代碼如下:
<!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>選項(xiàng)卡</title>
<script type="text/javascript">
</script>
<style type="text/css">
* { margin:0; padding:0; word-break:break-all; }
h1, h2, h3, h4, h5, h6 { font-size:1em; }
a { color:#333; text-decoration:none; }
a:hover { text-decoration:underline; }
ul, li { list-style:none; }
fieldset, img { border:none; }
#hotnews { width:260px; margin:1px; margin-left:auto; margin-right:auto;font-size:12px;}
#hotnews_caption { width:260px; overflow:hidden; border-bottom:1px solid #FAFAFA; }
#hotnews_caption ul { float:right; }
#hotnews_caption ul li { float:left; border-left:1px solid #FFF; width:85px; line-height:25px; text-align:center; cursor:pointer;font-size:12px; }
#hotnews_caption .normal { background:#E4E4E4; }
#hotnews_caption .current{ background:#C2130E; color:#FFF; }
#hotnews_content {}
#hotnews_content .normal { display:none; }
#hotnews_content .current { display:block; }
#hotnews_content ul { padding:8px 0 0 5px; }
#hotnews_content ul li a { font-size:12px;letter-spacing:1pt;line-height:14pt;}
</style>
<script type="text/javascript">
function secBoard(elementID,listName,n) {
var elem = document.getElementById(elementID);
var elemlist = elem.getElementsByTagName("li");
for (var i=0; i<elemlist.length; i++) {
elemlist[i].className = "normal";
var m = i+1;
document.getElementById(listName+"_"+m).className = "normal";
}
elemlist[n-1].className = "current";
document.getElementById(listName+"_"+n).className = "current";
}
</script>
</head>
<body style=" margin-top:15px;">
<div id="hotnews">
<div id="hotnews_caption">
<ul>
<li class="current" onmouseover="secBoard('hotnews_caption','list',1);">數(shù)字商務(wù)平臺(tái)</li>
<li class="normal" onmouseover="secBoard('hotnews_caption','list',2);">4GFax傳真服務(wù)</li>
<li class="normal" onmouseover="secBoard('hotnews_caption','list',3);">信息安全服務(wù)</li>
</ul>
</div>
<div id="hotnews_content">
<div class="current" id="list_1">
<ul>
<li> <a href="products.aspx" target="_top">全真通數(shù)字商務(wù)平臺(tái)是基于PKI體系,通過加密、簽名、認(rèn)證等手段,依據(jù)我國(guó)的數(shù)字簽名法,在Internet上建立的一套安全、可信、具有法律效力的電子文件交換平臺(tái)。為數(shù)字商務(wù)和數(shù)字政務(wù)服務(wù)!是我國(guó)數(shù)字簽名法最有價(jià)值的推廣應(yīng)用產(chǎn)品!</a></li>
</ul>
</div>
<div class="normal" id="list_2">
<ul>
<li> <a href="products.aspx" target="_top">基于數(shù)字中繼和模擬線路并結(jié)合互聯(lián)網(wǎng)形成了面向企業(yè)和政府用戶傳真收發(fā)服務(wù)的傳真服務(wù)系統(tǒng),集傳真的管理和收發(fā)于一體,為企業(yè)和政府提供智能傳真解決方案。</a></li>
</ul>
</div>
<div class="normal" id="list_3">
<ul>
<li> <a href="products.aspx" target="_top">基于PKI體系,結(jié)合數(shù)字證書的應(yīng)用為企業(yè)和政府提供的身份認(rèn)證、加密、簽名的技術(shù)解決方案,實(shí)現(xiàn)用戶身份的可鑒別性、通道的安全性、文件的安全性、主機(jī)的安全性等系列產(chǎn)品。</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>
希望本文所述對(duì)大家的JavaScript程序設(shè)計(jì)有所幫助。
- JS使用面向?qū)ο蠹夹g(shù)實(shí)現(xiàn)的tab選項(xiàng)卡效果示例
- js基于面向?qū)ο髮?shí)現(xiàn)網(wǎng)頁(yè)TAB選項(xiàng)卡菜單效果代碼
- javascript實(shí)現(xiàn)tabs選項(xiàng)卡切換效果(自寫原生js)
- js實(shí)現(xiàn)tab選項(xiàng)卡函數(shù)代碼
- 原生js實(shí)現(xiàn)tab選項(xiàng)卡切換
- 4種JavaScript實(shí)現(xiàn)簡(jiǎn)單tab選項(xiàng)卡切換的方法
- js簡(jiǎn)單實(shí)現(xiàn)豎向tab選項(xiàng)卡的方法
- JS實(shí)現(xiàn)滑動(dòng)菜單效果代碼(包括Tab,選項(xiàng)卡,橫向等效果)
- JS實(shí)現(xiàn)簡(jiǎn)單的tab切換選項(xiàng)卡效果
- JS實(shí)現(xiàn)的最簡(jiǎn)Table選項(xiàng)卡效果
- JS面向?qū)ο缶幊虒?shí)現(xiàn)的Tab選項(xiàng)卡案例詳解
相關(guān)文章
Boostrap柵格系統(tǒng)與自己額外定義的媒體查詢的沖突問題
這篇文章主要介紹了Boostrap柵格系統(tǒng)與自己額外定義的媒體查詢的沖突問題,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下2017-02-02
通過JS自動(dòng)隱藏手機(jī)瀏覽器的地址欄實(shí)現(xiàn)原理與代碼
大家通過手機(jī)自帶瀏覽器打開百度、淘寶,在首頁(yè)加載完畢后,會(huì)自動(dòng)隱藏頁(yè)面上方的地址欄,感興趣的朋友可以參考下2013-01-01
requireJS模塊化實(shí)現(xiàn)返回頂部功能的方法詳解
這篇文章主要介紹了requireJS模塊化實(shí)現(xiàn)返回頂部功能的方法,結(jié)合實(shí)例形式詳細(xì)分析了requireJS的使用步驟及返回頂部功能的相關(guān)操作技巧,需要的朋友可以參考下2017-10-10
原生JS+HTML5實(shí)現(xiàn)跟隨鼠標(biāo)一起流動(dòng)的粒子動(dòng)畫效果
這篇文章主要介紹了原生JS+HTML5實(shí)現(xiàn)跟隨鼠標(biāo)一起流動(dòng)的粒子動(dòng)畫效果,涉及javascript事件響應(yīng)、數(shù)值運(yùn)算及頁(yè)面元素屬性動(dòng)態(tài)操作相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下2018-05-05
基于Bootstrap模態(tài)對(duì)話框只加載一次 remote 數(shù)據(jù)的解決方法
下面小編就為大家?guī)硪黄贐ootstrap模態(tài)對(duì)話框只加載一次 remote 數(shù)據(jù)的解決方法。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-07-07

