您现在的位置是:网站首页> 编程资料编程资料

JavaScript实现Tab点击切换_javascript技巧_

2023-05-24 338人已围观

简介 JavaScript实现Tab点击切换_javascript技巧_

Tab 选项卡切换效果在现如今的网页中,运用的也是比较多的,包括点击切换、滑动切换、延迟切换、自动切换等多种效果,在这篇博文里,我们是通过原生 Jquery 来实现 Tab 点击切换的效果

例如:

html

     
       
               
  • 111
  •            
  • 222
  •            
  • 333
  •            
  • 444
  •            
  • 555
  •            
  • 666
  •        
       
           
               

111

           
           
               

222

           
           
               

333

           
           
               

444

           
           
               

555

           
           
               

666

           
       

css 

*{             padding: 0;             margin: 0;         }         li{             list-style: none;           }         .gw_b_tab{     color: #333333;     width: 240px;     height: 490px;     background: #FFFFFF;     border-radius: 8px;     overflow: hidden;     overflow-y: hidden; } .gw_b_item{     height: 82px;     padding: 0 22px;     position: relative;     font-size: 16px;     line-height: 80px;     text-align: center;     cursor: pointer;     border-radius: 8px;     font-weight: bold;     white-space: nowrap; } .gw_b_box{     /* display: none; */     width: 880px;     position: absolute;     right: 0;     top: 0;     display: none;     background: #FB6638;     height: 490px;     border-radius: 30px; } .gw_b_item2{     background-color: #FB6638;     color: #fff; } .gw_box_tit{     height: 48px;     line-height: 48px;     font-size: 24px;     color: #ffffff;     margin-bottom: 18px;     text-align: center; }

 js

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。

-六神源码网