您好,登錄后才能下訂單哦!
本文小編為大家詳細(xì)介紹“jQuery怎么實(shí)現(xiàn)移動(dòng)端Tab選項(xiàng)卡效果”,內(nèi)容詳細(xì),步驟清晰,細(xì)節(jié)處理妥當(dāng),希望這篇“jQuery怎么實(shí)現(xiàn)移動(dòng)端Tab選項(xiàng)卡效果”文章能幫助大家解決疑惑,下面跟著小編的思路慢慢深入,一起來(lái)學(xué)習(xí)新知識(shí)吧。
效果圖:
代碼如下:
<!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 >商品介紹</li> <li>評(píng)價(jià)</li> </ul> </div> </div> </body> </html>
讀到這里,這篇“jQuery怎么實(shí)現(xiàn)移動(dòng)端Tab選項(xiàng)卡效果”文章已經(jīng)介紹完畢,想要掌握這篇文章的知識(shí)點(diǎn)還需要大家自己動(dòng)手實(shí)踐使用過(guò)才能領(lǐng)會(huì),如果想了解更多相關(guān)內(nèi)容的文章,歡迎關(guān)注億速云行業(yè)資訊頻道。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。