jQuery實(shí)現(xiàn)移動(dòng)端Tab選項(xiàng)卡效果
效果圖:
代碼如下:
<!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í)或者工作能帶來一定的幫助,同時(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)畫位移)
- 動(dòng)感效果的TAB選項(xiàng)卡jquery 插件
- 基于jquery實(shí)現(xiàn)的tab選項(xiàng)卡功能示例【附源碼下載】
相關(guān)文章
jQuery使用正則驗(yàn)證15/18身份證的方法示例
這篇文章主要介紹了jQuery使用正則驗(yàn)證15/18身份證的方法,涉及jQuery基于正則進(jìn)行數(shù)字字符串驗(yàn)證相關(guān)操作技巧,需要的朋友可以參考下2017-04-04jQuery插件實(shí)現(xiàn)無縫滾動(dòng)特效
今天給大家分享一款頁面無縫滾動(dòng)的jquery插件,支持上下左右,淡入淡出,滾動(dòng)時(shí)間設(shè)置,動(dòng)畫時(shí)間設(shè)置,感興趣的小伙伴們可以參考一下2015-11-11jQuery當(dāng)鼠標(biāo)懸停時(shí)放大圖片的效果實(shí)例
這是一個(gè)基于jQuery的效果,當(dāng)鼠標(biāo)在小圖片上懸停時(shí),會(huì)彈出一個(gè)大圖,該大圖會(huì)跟隨鼠標(biāo)的移動(dòng)而移動(dòng)2013-07-07JQuery實(shí)現(xiàn)樣式設(shè)置、追加、移除與切換的方法
這篇文章主要介紹了JQuery實(shí)現(xiàn)樣式設(shè)置、追加、移除與切換的方法,涉及jQuery樣式操作的常用技巧,非常簡(jiǎn)單實(shí)用,需要的朋友可以參考下2015-06-06jQuery實(shí)現(xiàn)打開網(wǎng)頁自動(dòng)彈出遮罩層或點(diǎn)擊彈出遮罩層功能示例
這篇文章主要介紹了jQuery實(shí)現(xiàn)打開網(wǎng)頁自動(dòng)彈出遮罩層或點(diǎn)擊彈出遮罩層功能,涉及jQuery事件響應(yīng)及窗口元素屬性的相關(guān)操作技巧,需要的朋友可以參考下2017-10-10jcarousellite.js 基于Jquery的圖片無縫滾動(dòng)插件
基于Jquery的圖片無縫滾動(dòng)插件,需要的朋友可以參考下。2010-12-12文本框水印提示效果的簡(jiǎn)單實(shí)現(xiàn)代碼
本篇文章主要是對(duì)文本框水印提示效果的簡(jiǎn)單實(shí)現(xiàn)代碼進(jìn)行了介紹,需要的朋友可以過來參考下,希望對(duì)大家有所幫助2014-02-02jquery dataview數(shù)據(jù)視圖插件使用方法
這篇文章主要介紹了jquery dataview數(shù)據(jù)視圖插件使用方法,數(shù)據(jù)填充與視圖更新利器,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2016-12-12