jQuery實(shí)現(xiàn)移動(dòng)端Tab選項(xiàng)卡效果
更新時(shí)間:2017年03月15日 11:07:46 作者:艾米
本篇文章主要介紹了jQuery實(shí)現(xiàn)移動(dòng)端Tab選項(xiàng)卡效果的實(shí)例。具有很好的參考價(jià)值。下面跟著小編一起來(lái)看下吧
效果圖:

代碼如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>移動(dòng)端Tab選項(xiàng)卡</title>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script>
$(function() {
$(".tab a").click(function() {
$(this).addClass('curr').siblings().removeClass('curr');
var index = $(this).index();
number = index;
$('.nav .content li').hide();
$('.nav .content li:eq(' + index + ')').show();
});
})
</script>
<style>
*{
margin: 0;
padding: 0;
}
div, input, textarea, button, a {
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
ul, li, ol{
list-style: none;
}
a {
color: #323232;
outline-style: none;
text-decoration: none;
}
.border-b {
position: relative;
}
.border-b:after {
top: auto;
bottom: 0;
}
.border-t:before, .border-b:after {
content: '';
position: absolute;
left: 0;
background: #ddd;
right: 0;
height: 1px;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
}
.nav {
background-color: #fff;
text-align: center;
}
.nav .tab {
width: 100%;
position: relative;
overflow: hidden;
}
.tab a {
float: left;
width: 49%;
height: 2.56rem;
line-height:2.56rem;
display: inline-block;
border-right: 1px solid #e1e1e1;
}
.tab a:last-child {
border-right: 0;
}
.tab .curr {
border-bottom: 2px solid #fc7831;
color: #fc7831;
}
.content ul li {
display: none;
padding: 3%;
width: 94%;
}
</style>
</head>
<body>
<div class="nav">
<div class="tab border-b">
<a href="javascript:;" rel="external nofollow" rel="external nofollow" class="curr">商品介紹</a>
<a href="javascript:;" rel="external nofollow" rel="external nofollow" >評(píng)價(jià)(99)</a>
</div>
<div class="content">
<ul>
<li style="display: block">商品介紹</li>
<li>評(píng)價(jià)</li>
</ul>
</div>
</div>
</body>
</html>
以上就是本文的全部?jī)?nèi)容,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作能帶來(lái)一定的幫助,同時(shí)也希望多多支持腳本之家!
您可能感興趣的文章:
- 基于JQuery的6個(gè)Tab選項(xiàng)卡插件
- JQuery Tab選項(xiàng)卡效果代碼改進(jìn)版
- jQuery實(shí)現(xiàn)TAB選項(xiàng)卡切換特效簡(jiǎn)單演示
- jQuery實(shí)現(xiàn)Tab選項(xiàng)卡切換效果簡(jiǎn)單演示
- jquery實(shí)現(xiàn)超簡(jiǎn)潔的TAB選項(xiàng)卡效果代碼
- jQuery實(shí)現(xiàn)滾動(dòng)切換的tab選項(xiàng)卡效果代碼
- jQuery封裝的tab選項(xiàng)卡插件分享
- jquery實(shí)現(xiàn)tab選項(xiàng)卡切換效果(懸停、下方橫線動(dòng)畫(huà)位移)
- 動(dòng)感效果的TAB選項(xiàng)卡jquery 插件
- 基于jquery實(shí)現(xiàn)的tab選項(xiàng)卡功能示例【附源碼下載】
相關(guān)文章
使用jQuery解決IE與FireFox下createElement方法的差異
使用jQuery解決IE與FireFox下createElement方法的差異。需要的朋友可以過(guò)來(lái)參考下,希望對(duì)大家有所幫助2013-11-11
自己使用jquery寫(xiě)的一個(gè)無(wú)縫滾動(dòng)的插件
這篇文章主要介紹的是自己使用jquery寫(xiě)的一個(gè)無(wú)縫滾動(dòng)的插件,個(gè)人感覺(jué)還不錯(cuò),需要的朋友可以參考下2014-04-04
jQuery實(shí)現(xiàn)移動(dòng)端滑塊拖動(dòng)選擇數(shù)字效果
這篇文章主要介紹了jQuery實(shí)現(xiàn)移動(dòng)端滑塊拖動(dòng)選擇數(shù)字效果,jQuery實(shí)現(xiàn)移動(dòng)端滑塊拖動(dòng)效果,感興趣的小伙伴們可以參考一下2015-12-12
對(duì)Jquery中的ajax再封裝,簡(jiǎn)化操作示例
這篇文章主要介是對(duì)Jquery中的ajax再封裝,簡(jiǎn)化操作示例進(jìn)行了介紹,需要的朋友可以過(guò)來(lái)參考下,希望對(duì)大家有所幫助2014-02-02
jQuery函數(shù)map()和each()介紹及異同點(diǎn)分析
這篇文章主要介紹了jQuery函數(shù)map()和each()介紹及異同點(diǎn)分析,需要的朋友可以參考下2014-11-11
JQuery中綁定事件(bind())和移除事件(unbind())
本文主要向大家詳細(xì)介紹了jQuery的綁定事件和移除事件的使用方法和示例分享,這里推薦給有需要的小伙伴們參考下。2015-02-02

