jquery實(shí)現(xiàn)未經(jīng)美化的簡(jiǎn)潔TAB菜單效果
本文實(shí)例講述了jquery實(shí)現(xiàn)未經(jīng)美化的簡(jiǎn)潔TAB菜單效果。分享給大家供大家參考。具體如下:
這是一個(gè)看上去未經(jīng)美化的簡(jiǎn)潔TAB選項(xiàng)卡,觸發(fā)類的動(dòng)作都是完整的,有興趣的自己進(jìn)行美化,美化漂亮了還是相當(dāng)不錯(cuò)的,代碼簡(jiǎn)潔,對(duì)學(xué)習(xí)參考比較不錯(cuò),使用了jQuery插件。
運(yùn)行效果截圖如下:

在線演示地址如下:
http://demo.jb51.net/js/2015/jquery-show-tab-plug-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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>未經(jīng)美化的簡(jiǎn)潔TAB</title>
<style>
body {font:normal 12px/20px simsun; margin:0 auto; padding:0;}
* {margin: 0px; padding: 0px;}
h4{font-size:14px;}
h5{font-size:12px;}
img {border:none;}
ul,li{list-style-type:none;}
a{text-decoration:none;}
a:link{text-decoration:none;}
a:hover{text-decoration:underline; color:#ffae00;}
#tab{width:240px; margin:0 auto; text-align:center;}
.menu{height:35px; line-height:32px; padding-top:1px;}
.menu a{display:inline-block; height:35px; line-height:35px; width:116px; text-align:center; font-size:20px; color:#999999; font-weight:bold;}
.menu a:hover, .menu a.on{color:#d33b55; text-decoration:none;}
.cnt{border:1px solid #999999; width:240px; height:100px;}
</style>
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".menu a").each(function(i){
$(this).click(function(){
$(".menu a").removeClass("on").eq(i).addClass("on");
$(".cnt").hide().eq(i).show();
return false; //防止a跳轉(zhuǎn);
})
})
});
</script>
</head>
<body>
<div id="tab">
<div class="menu">
<a href="#" class="on">ASP源碼</a>
<a href="#">Java源碼</a>
</div>
<div class="cnt">
<ul>
<li>ASP源碼1</li>
<li>ASP源碼2</li>
<li>ASP源碼3</li>
</ul>
</div>
<div class="cnt" style="display:none;">
<ul>
<li>Java源碼1</li>
<li>Java源碼2</li>
<li>Java源碼3</li>
</ul>
</div>
</div>
</body>
</html>
希望本文所述對(duì)大家的jquery程序設(shè)計(jì)有所幫助。
- jQuery實(shí)現(xiàn)帶幻燈的tab滑動(dòng)切換風(fēng)格菜單代碼
- jQuery實(shí)現(xiàn)滾動(dòng)切換的tab選項(xiàng)卡效果代碼
- jQuery網(wǎng)頁(yè)選項(xiàng)卡插件rTabs用法實(shí)例分析
- jQuery實(shí)現(xiàn)TAB風(fēng)格的全國(guó)省份城市滑動(dòng)切換效果代碼
- jquery實(shí)現(xiàn)的仿天貓側(cè)導(dǎo)航tab切換效果
- 原生js與jQuery實(shí)現(xiàn)簡(jiǎn)單的tab切換特效對(duì)比
- jquery實(shí)現(xiàn)TAB選項(xiàng)卡鼠標(biāo)經(jīng)過帶延遲效果的方法
- jQuery實(shí)現(xiàn)tab選項(xiàng)卡效果的方法
- jquery實(shí)現(xiàn)左右滑動(dòng)菜單效果代碼
- jQuery實(shí)現(xiàn)響應(yīng)鼠標(biāo)背景變化的動(dòng)態(tài)菜單效果代碼
相關(guān)文章
解析ajaxFileUpload 異步上傳文件簡(jiǎn)單使用
本篇文章主要介紹了ajaxFileUpload 異步上傳文件簡(jiǎn)單使用,jQuery插件AjaxFileUpload可以實(shí)現(xiàn)ajax文件上傳。有興趣的可以了解一下,2016-12-12
jQuery實(shí)現(xiàn)的多屏圖像圖層切換效果實(shí)例
這篇文章主要介紹了jQuery實(shí)現(xiàn)的多屏圖像圖層切換效果,可實(shí)現(xiàn)多個(gè)圖層的點(diǎn)擊切換效果,設(shè)計(jì)jQuery鼠標(biāo)事件及樣式的操作技巧,需要的朋友可以參考下2015-05-05
jQuery實(shí)現(xiàn)下拉菜單(內(nèi)容為時(shí)間)的實(shí)時(shí)更新及圖表的隨動(dòng)更新的方法
這篇文章主要介紹了實(shí)現(xiàn)下拉菜單(內(nèi)容為時(shí)間)的實(shí)時(shí)更新及圖表的隨動(dòng)更新的方法的相關(guān)資料,需要的朋友可以參考下2016-07-07
jquery img src 獲取實(shí)現(xiàn)代碼
利用jquery 取得IMG src的問題,有需要的朋友可以參考下。2009-05-05
jQuery Autocomplete自動(dòng)完成插件
jQuery Autocomplete plugin 寫的比較滿意,拿出來(lái)分享,歡迎大家找BUG。2010-07-07
Jquery使用原生AJAX方法請(qǐng)求數(shù)據(jù)
本文詳細(xì)講解了Jquery使用AJAX方法請(qǐng)求數(shù)據(jù),文中通過示例代碼介紹的非常詳細(xì)。對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2023-02-02
jquery實(shí)現(xiàn)彈出div,始終顯示在屏幕正中間的簡(jiǎn)單實(shí)例
本篇文章主要是對(duì)jquery實(shí)現(xiàn)彈出div,始終顯示在屏幕正中間的簡(jiǎn)單實(shí)例進(jìn)行了介紹,需要的朋友可以過來(lái)參考下,希望對(duì)大家有所幫助2014-03-03

