實(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">無效</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)簽頁/選項(xiàng)卡
- jquery tools之tabs 選項(xiàng)卡/頁簽
- JQuery Tab選項(xiàng)卡效果代碼改進(jìn)版
- jQuery EasyUI Tab 選項(xiàng)卡問題小結(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)卡切換效果簡單演示
- jquery實(shí)現(xiàn)tab選項(xiàng)卡切換效果(懸停、下方橫線動(dòng)畫位移)
相關(guān)文章
50 個(gè) jQuery 插件可將你的網(wǎng)站帶到另外一個(gè)高度
Query架構(gòu)的開發(fā)人員能夠創(chuàng)建一個(gè)插件代碼來擴(kuò)展其功能,從而能夠產(chǎn)生一些最好的插件,讓你的網(wǎng)站或任何給定的項(xiàng)目達(dá)到一個(gè)全新的水平。2016-04-04IE中的File域無法清空使用jQuery重設(shè)File域
IE中的File域無法清空,可能你看到的是已經(jīng)沒有值了,其實(shí)它還是存在的,下面有個(gè)不錯(cuò)示例,大家可以參考下2014-04-04Struts2的s:radio標(biāo)簽使用及用jquery添加change事件
用到Struts2的s:radio標(biāo)簽時(shí)想給它添加一個(gè)change事件,由于此標(biāo)簽為頁面自動(dòng)生成一個(gè)radio組,不可以像正常那樣控制,于是想到用jquery來實(shí)現(xiàn)2013-04-04JQuery動(dòng)態(tài)添加和刪除表格行的方法
這篇文章主要介紹了JQuery動(dòng)態(tài)添加和刪除表格行的方法,實(shí)例分析了jQuery中動(dòng)態(tài)操作表格行的技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-03-03