jquery實(shí)現(xiàn)超簡潔的TAB選項(xiàng)卡效果代碼
本文實(shí)例講述了jquery實(shí)現(xiàn)超簡潔的TAB選項(xiàng)卡效果代碼。分享給大家供大家參考。具體如下:
這是一款超簡潔的TAB選項(xiàng)卡,個(gè)人覺得有點(diǎn)太簡單,簡單的有點(diǎn)不習(xí)慣,美化修飾一下其實(shí)效果更好。實(shí)際上應(yīng)該為點(diǎn)擊過的TAB添加一個(gè)背景色,區(qū)分一下,這樣比較好。
先來看看運(yùn)行效果截圖:

在線演示地址如下:
http://demo.jb51.net/js/2015/jquery-easy-tab-cha-menu-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>超簡潔的TAB選項(xiàng)卡</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;}
.menu li{width:60px; height:30px; text-align:center; line-height:30px; float:left; cursor:pointer;}
.menu li:hover, .menu li.on{color:#f00;}
.cont{width:180px; height:100px; border:1px solid #666666; clear:both;}
</style>
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".menu li").click(function(){
var Num=$(this).index("li");
$(".menu li").removeClass("on").eq(Num).addClass("on");
$(".cont").hide().eq(Num).show();
});
});
</script>
</head>
<body>
<div class="tab">
<ul class="menu">
<li class="on">北歐之旅</li>
<li>音樂維也納</li>
<li>天堂瑞士</li>
</ul>
<div class="cont">北歐之旅</div>
<div class="cont" style="display:none;">音樂維也納</div>
<div class="cont" style="display:none;">天堂瑞士</div>
</div>
</body>
</html>
希望本文所述對大家的jquery程序設(shè)計(jì)有所幫助。
- 基于JQuery的6個(gè)Tab選項(xiàng)卡插件
- JQuery Tab選項(xiàng)卡效果代碼改進(jìn)版
- jQuery實(shí)現(xiàn)TAB選項(xiàng)卡切換特效簡單演示
- jQuery實(shí)現(xiàn)Tab選項(xiàng)卡切換效果簡單演示
- jQuery實(shí)現(xiàn)滾動切換的tab選項(xiàng)卡效果代碼
- jQuery實(shí)現(xiàn)移動端Tab選項(xiàng)卡效果
- jQuery封裝的tab選項(xiàng)卡插件分享
- jquery實(shí)現(xiàn)tab選項(xiàng)卡切換效果(懸停、下方橫線動畫位移)
- 動感效果的TAB選項(xiàng)卡jquery 插件
- 基于jquery實(shí)現(xiàn)的tab選項(xiàng)卡功能示例【附源碼下載】
相關(guān)文章
jQuery插件HighCharts繪制2D帶有Legend的餅圖效果示例【附demo源碼下載】
這篇文章主要介紹了jQuery插件HighCharts繪制2D帶有Legend的餅圖效果,結(jié)合實(shí)例形式分析了jQuery使用HighCharts繪制帶明細(xì)顯示的餅狀圖效果實(shí)現(xiàn)技巧,并附帶了demo源碼供讀者下載參考,需要的朋友可以參考下2017-03-03
Juery解決tablesorter中文排序和字符范圍的方法
這篇文章主要介紹了Juery解決tablesorter中文排序和字符范圍的方法,實(shí)例分析了jQuery針對tablesorter中文排序和字符范圍的解決方法,需要的朋友可以參考下2015-05-05
JQuery Easyui Tree的oncheck事件實(shí)現(xiàn)代碼
最近項(xiàng)目中有用到Easyui Tree,我想要checkbox的選中事件,但是api只提供了一個(gè)onClick事件,我百度、google之后,額,還是看js吧2010-05-05
jQuery Form插件使用詳解_動力節(jié)點(diǎn)Java學(xué)院整理
這篇文章主要為大家詳細(xì)介紹了jQuery Form插件的使用方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-07-07
JQuery Tips(2) 關(guān)于$()包裝集你不知道的
包裝集總是面向集合的,需要的朋友可以參考下。2009-12-12

