實(shí)用的Jquery選項卡TAB示例代碼
更新時間:2013年08月28日 14:53:01 作者:
Jquery選項卡想必大家并不陌生,本文為大家介紹個比較實(shí)用的jquery TAB選項卡,喜歡的朋友可以學(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選項卡</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">
//選項卡切換
$(function () {
$(".stitle li").click(function () {
var index_tab = $(this).parent().children().index($(this)); //選項卡的索引值
$(this).parent().find(".open").removeClass("open").addClass("close"); //選項卡背景處理
$(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個Tab選項卡插件
- jQuery EasyUI API 中文文檔 - Tabs標(biāo)簽頁/選項卡
- jquery tools之tabs 選項卡/頁簽
- JQuery Tab選項卡效果代碼改進(jìn)版
- jQuery EasyUI Tab 選項卡問題小結(jié)
- jQuery實(shí)現(xiàn)的Tab滑動選項卡及圖片切換(多種效果)小結(jié)
- jquery自動切換tabs選項卡的具體實(shí)現(xiàn)
- jquery.idTabs 選項卡使用示例代碼
- jQuery實(shí)現(xiàn)Tab選項卡切換效果簡單演示
- jquery實(shí)現(xiàn)tab選項卡切換效果(懸停、下方橫線動畫位移)
相關(guān)文章
淺談jQuery綁定事件會疊加的解決方法和心得總結(jié)
下面小編就為大家?guī)硪黄獪\談jQuery綁定事件會疊加的解決方法和心得總結(jié)。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-10-10
jquery ui dialog實(shí)現(xiàn)彈窗特效的思路及代碼
這篇文章介紹了jquery ui dialog實(shí)現(xiàn)彈窗特效的思路及代碼,有需要的朋友可以參考一下2013-08-08
基于EasyUI的基礎(chǔ)之上實(shí)現(xiàn)樹形功能菜單
這篇文章主要介紹了基于EasyUI的基礎(chǔ)之上實(shí)現(xiàn)樹形功能菜單,非常不錯,具有參考借鑒價值,需要的朋友可以參考下2017-06-06
JQuery擴(kuò)展插件Validate 5添加自定義驗證方法
從前面的示例中不難看出validate中自帶的驗證方法足以滿足一般的要求,對于特別的要求可以使用addMethod(name,method,message)添加自定義的驗證規(guī)則,下面的示例中添加了一個用于正則表達(dá)式驗證的擴(kuò)展驗證的方法2011-09-09
使用簡潔的jQuery方法實(shí)現(xiàn)隔行換色功能
本篇文章主要介紹了使用簡潔的jQuery方法實(shí)現(xiàn)隔行換色功能。需要的朋友可以過來參考下,希望對大家有所幫助2014-01-01

