實(shí)用的Jquery選項(xiàng)卡TAB示例代碼
更新時(shí)間:2013年08月28日 14:53:01 作者:
Jquery選項(xiàng)卡想必大家并不陌生,本文為大家介紹個(gè)比較實(shí)用的jquery TAB選項(xiàng)卡,喜歡的朋友可以學(xué)習(xí)下
復(fù)制代碼 代碼如下:
<!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>實(shí)用的Jquery選項(xiàng)卡</title>
<script language="javascript" type="text/javascript" src="jquery-1.9.1.min.js"></script>
<style type="text/css">
.order_box .stitle {
width: 825px;
clear: right;
height: 27px;
border-bottom: 2px solid #A10000;
}
.order_box .stitle .close {
width: 80px;
height: 18px;
border-top: 1px solid #dedede;
border-left: 1px solid #dedede;
border-right: 1px solid #dedede;
background: #f1f1f1;
color: #000;
text-align: center;
float: left;
margin-right: 5px;
padding-top: 8px;
}
.order_box .stitle .open {
width: 82px;
height: 20px;
background: #A10000;
color: #fff;
text-align: center;
float: left;
margin-right: 5px;
padding-top: 8px;
overflow: hidden;
}
.order_box ul li {
cursor: pointer;
display: list-item;
list-style:none;
}
</style>
<script type="text/javascript">
//選項(xiàng)卡切換
$(function () {
$(".stitle li").click(function () {
var index_tab = $(this).parent().children().index($(this)); //選項(xiàng)卡的索引值
$(this).parent().find(".open").removeClass("open").addClass("close"); //選項(xiàng)卡背景處理
$(this).removeClass("close").addClass("open");
var content_obj = $(".cntorder") //內(nèi)容節(jié)點(diǎn)
content_obj.hide();
content_obj.eq(index_tab).show();
});
});
</script>
</head>
<body>
<div class="order_box">
<div class="stitle">
<ul>
<li class="open">進(jìn)行中</li>
<li class="close">已完成</li>
<li class="close">無(wú)效</li>
</ul>
</div>
<div class="cntorder" >tab1</div>
<div class="cntorder" style="display: none;">tab2</div>
<div class="cntorder" style="display: none;">tab3</div>
</div>
</body>
</html>
您可能感興趣的文章:
- 基于JQuery的6個(gè)Tab選項(xiàng)卡插件
- jQuery EasyUI API 中文文檔 - Tabs標(biāo)簽頁(yè)/選項(xiàng)卡
- jquery tools之tabs 選項(xiàng)卡/頁(yè)簽
- JQuery Tab選項(xiàng)卡效果代碼改進(jìn)版
- jQuery EasyUI Tab 選項(xiàng)卡問(wèn)題小結(jié)
- jQuery實(shí)現(xiàn)的Tab滑動(dòng)選項(xiàng)卡及圖片切換(多種效果)小結(jié)
- jquery自動(dòng)切換tabs選項(xiàng)卡的具體實(shí)現(xiàn)
- jquery.idTabs 選項(xiàng)卡使用示例代碼
- jQuery實(shí)現(xiàn)Tab選項(xiàng)卡切換效果簡(jiǎn)單演示
- jquery實(shí)現(xiàn)tab選項(xiàng)卡切換效果(懸停、下方橫線動(dòng)畫(huà)位移)
相關(guān)文章
淺談jQuery綁定事件會(huì)疊加的解決方法和心得總結(jié)
下面小編就為大家?guī)?lái)一篇淺談jQuery綁定事件會(huì)疊加的解決方法和心得總結(jié)。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-10-10
jquery ui dialog實(shí)現(xiàn)彈窗特效的思路及代碼
這篇文章介紹了jquery ui dialog實(shí)現(xiàn)彈窗特效的思路及代碼,有需要的朋友可以參考一下2013-08-08
基于EasyUI的基礎(chǔ)之上實(shí)現(xiàn)樹(shù)形功能菜單
這篇文章主要介紹了基于EasyUI的基礎(chǔ)之上實(shí)現(xiàn)樹(shù)形功能菜單,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下2017-06-06
jQuery過(guò)濾選擇器經(jīng)典應(yīng)用
這篇文章主要為大家詳細(xì)介紹了jQuery過(guò)濾選擇器經(jīng)典應(yīng)用,具有一定的實(shí)用性,感興趣的小伙伴們可以參考一下2016-08-08
JQuery擴(kuò)展插件Validate 5添加自定義驗(yàn)證方法
從前面的示例中不難看出validate中自帶的驗(yàn)證方法足以滿足一般的要求,對(duì)于特別的要求可以使用addMethod(name,method,message)添加自定義的驗(yàn)證規(guī)則,下面的示例中添加了一個(gè)用于正則表達(dá)式驗(yàn)證的擴(kuò)展驗(yàn)證的方法2011-09-09
使用簡(jiǎn)潔的jQuery方法實(shí)現(xiàn)隔行換色功能
本篇文章主要介紹了使用簡(jiǎn)潔的jQuery方法實(shí)現(xiàn)隔行換色功能。需要的朋友可以過(guò)來(lái)參考下,希望對(duì)大家有所幫助2014-01-01

