国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

jQuery實現移動端Tab選項卡效果

2019-11-19 17:08:56
字體:
來源:轉載
供稿:網友

效果圖:

代碼如下:

<!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>移動端Tab選項卡</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" >評價(99)</a> </div> <div class="content">  <ul>   <li style="display: block">商品介紹</li>   <li>評價</li>  </ul> </div></div></body></html>

以上就是本文的全部內容,希望本文的內容對大家的學習或者工作能帶來一定的幫助,同時也希望多多支持武林網!

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 阿荣旗| 周宁县| 利津县| 沂水县| 南康市| 谢通门县| 广安市| 库伦旗| 常山县| 昭平县| 铜梁县| 安岳县| 仁寿县| 泸定县| 安阳县| 安新县| 龙口市| 宁城县| 澳门| 无锡市| 集贤县| 昭苏县| 新干县| 资溪县| 龙里县| 奉节县| 个旧市| 峨眉山市| 达孜县| 双峰县| 惠东县| 鹤壁市| 吴桥县| 仁寿县| 漾濞| 姜堰市| 龙海市| 安吉县| 肇州县| 巨鹿县| 酉阳|