gmnon.cn-疯狂蹂躏欧美一区二区精品,欧美精品久久久久a,高清在线视频日韩欧美,日韩免费av一区二区

站長資訊網
最全最豐富的資訊網站

jquery+swiper實現時間軸tab滑動切換顯示效果

根據時間軸進行tab頁面內容切換?下面本篇文章給大家介紹一下jquery時間軸tab切換效果實現結合swiper實現滑動顯示效果的方法,希望對大家有所幫助!

jquery+swiper實現時間軸tab滑動切換顯示效果

前端(vue)入門到精通課程:進入學習

需求:根據時間軸進行tab頁面內容切換(時間軸需要滑動查看并選擇)

實現思路:

結合swiper插件實現滑動顯示效果

根據transform: translateX進行左側切換效果的實現(具體實現css如下),實現非滾動的點擊切換效果,結合swiper進行修改。【相關教程推薦:jQuery教程】

實現效果:

jquery+swiper實現時間軸tab滑動切換顯示效果

實現代碼:需要配合swiper組件使用;左側導航是根據html結構和css3代碼,來生成的時間軸效果效果來源于http://www.htmleaf.com/css3/ui-design/201911275850.html

Swiper基礎演示地址:https://www.swiper.com.cn/demo/index.html

HTML:

  <div class="swiper-container box">     <div class="swiper-wrapper main-timeline">       <div class="swiper-slide timeline fd-active-line">         <a href="javascript:void(0);" class="timeline-content">           <div class="timeline-year">             <span>2019</span>           </div>         </a>         <div class="xians"></div>       </div>       <div class="swiper-slide timeline">         <a href="javascript:void(0);" class="timeline-content">           <div class="timeline-year">             <span>2018</span>           </div>         </a>         <div class="xians"></div>       </div>       <div class="swiper-slide timeline">         <a href="javascript:void(0);" class="timeline-content">           <div class="timeline-year">             <span>2017</span>           </div>         </a>         <div class="xians"></div>       </div>       <div class="swiper-slide timeline">         <a href="javascript:void(0);" class="timeline-content">           <div class="timeline-year">             <span>2016</span>           </div>         </a>         <div class="xians"></div>       </div>       <div class="swiper-slide timeline">         <a href="javascript:void(0);" class="timeline-content">           <div class="timeline-year">             <span>2015</span>           </div>         </a>         <div class="xians"></div>       </div>       <div class="swiper-slide timeline">         <a href="javascript:void(0);" class="timeline-content">           <div class="timeline-year">             <span>2014</span>           </div>         </a>         <div class="xians"></div>       </div>     </div>   </div>   <ul class="event_list">     <div>       <h3 id="2012">2019</h3>       <img src="./img/lh.jpg" alt="">     </div>     <div style="display: none;">       <h3 id="2012">2018</h3>       <img src="./img/lhls.jpg" alt="">     </div>     <div style="display: none;">       <h3 id="2011">2017</h3>       <img src="./img/lkss.jpg" alt="">     </div>     <div style="display: none;">       <h3 id="2011">2016</h3>       <img src="./img/luhu.jpg" alt="">     </div>     <div style="display: none;">       <h3 id="2011">2015</h3>       <img src="./img/luhuwhite.jpg" alt="">     </div>     <div style="display: none;">       <h3 id="2011">2014</h3>       <img src="./img/lhls.jpg" alt="">     </div>   </ul>   </div>

所需外部鏈接文件:

<script src="js/jquery.min_v1.0.js" type="text/javascript"></script>   <script src="js/swiper-bundle.min.js" type="text/javascript"></script>   <link rel="stylesheet" href="css/swiper-bundle.min.css">

CSS

.page {   width: 100%; }   .main-timeline {   font-family: 'Roboto', sans-serif;   width: 200px;   position: relative;   float: left; }   .main-timeline:after {   content: '';   display: block;   clear: both; }   .main-timeline:before {   /* content: '';   height: calc(100% + 80px);   width: 0px;   border: 2px solid #0870C5;   transform: translateX(-50%);   position: absolute;   left: 114px;   top: 0px; */ }   .main-timeline .timeline {   width: 4%;   /* padding: 140px 70px 0 25px; */   margin: 0 50px 0 0;   float: left;   position: relative; }   .main-timeline .timeline-content {   /* padding: 15px 15px 15px 40px;   border: 2px solid #00A79B; */   border-radius: 15px 0 15px 15px;   display: block;   position: relative; }   .main-timeline .timeline-content:hover {   text-decoration: none; }   .fd-active-line .timeline-content:after {   content: '';   background-color: #00A79B;   height: 18px;   width: 15px;   position: absolute;   right: -43px;   top: 27px;   /* clip-path: polygon(100% 0, 0 0, 0 100%); */ }   .main-timeline .timeline-year {   color: #fff;   background-color: #00A79B;   font-size: 24px;   font-weight: 900;   text-align: center;   line-height: 80px;   height: 80px;   width: 80px;   border-radius: 50%;   position: absolute;   right: -120px;   top: -40px; }   .main-timeline .timeline-year:after {   content: '';   height: 100px;   width: 100px;   border: 8px solid #00A79B;   border-left-color: transparent;   border-radius: 50%;   transform: translateX(-50%) translateY(-50%) rotate(-20deg);   position: absolute;   left: 50%;   top: 50%; }   .main-timeline .timeline-icon {   color: #fff;   background-color: #00A79B;   font-size: 35px;   text-align: center;   line-height: 50px;   height: 50px;   width: 50px;   border-radius: 50%;   transform: translateY(-50%);   position: absolute;   top: 50%;   left: -25px;   transition: all 0.3s; }   .main-timeline .title {   color: #222;   font-size: 20px;   font-weight: 900;   text-transform: uppercase;   letter-spacing: 1px;   margin: 0 0 7px 0; }   .main-timeline .description {   color: #222;   font-size: 15px;   letter-spacing: 1px;   text-align: justify;   margin: 0 0 5px; }   .main-timeline .timeline:nth-child(even) .timeline-content {}   .main-timeline .timeline:nth-child(even) .timeline-content:after {   transform: rotateY(180deg);   right: auto;   left: 123px; }   .main-timeline .timeline:nth-child(even) .timeline-year:after {   transform: translateX(-50%) translateY(-50%) rotate(200deg); }   .main-timeline .timeline:nth-child(even) .timeline-icon {   left: auto;   right: -25px; }   .timeline:nth-child(4n+2) .timeline-content, .timeline:nth-child(4n+2) .timeline-year:after {   border-color: #9E005D; }   .timeline:nth-child(4n+2) .timeline-year:after {   border-left-color: transparent; }   .timeline:nth-child(4n+2) .timeline-content:after, .timeline:nth-child(4n+2) .timeline-icon, .timeline:nth-child(4n+2) .timeline-year {   background-color: #9E005D; }   .timeline:nth-child(4n+3) .timeline-content, .timeline:nth-child(4n+3) .timeline-year:after {   border-color: #f24f0e; }   .timeline:nth-child(4n+3) .timeline-year:after {   border-left-color: transparent; }   .timeline:nth-child(4n+3) .timeline-content:after, .timeline:nth-child(4n+3) .timeline-icon, .timeline:nth-child(4n+3) .timeline-year {   background-color: #f24f0e; }   .timeline:nth-child(4n+4) .timeline-content, .timeline:nth-child(4n+4) .timeline-year:after {   border-color: #0870C5; }   .timeline:nth-child(4n+4) .timeline-year:after {   border-left-color: transparent; }   .timeline:nth-child(4n+4) .timeline-content:after, .timeline:nth-child(4n+4) .timeline-icon, .timeline:nth-child(4n+4) .timeline-year {   background-color: #0870C5; }   @media screen and (max-width:767px) {   .main-timeline:before {     display: none;   }     .main-timeline .timeline {     width: 100%;     padding-top: 80px;     padding-right: 12px;     margin-bottom: 20px;   }     .main-timeline .timeline:nth-child(even) {     padding-left: 10px;     padding-top: 80px;     margin-bottom: 20px;   }     .main-timeline .timeline-content,   .main-timeline .main-timeline .timeline:nth-child(even) .timeline-content {     background-color: #fff;     padding-top: 25px;   }     .main-timeline .timeline-content:after {     display: none;   }     .main-timeline .timeline-year {     font-size: 24px;     line-height: 70px;     height: 70px;     width: 70px;     right: 0;     top: -65px;   }     .main-timeline .timeline-year:after {     display: none;   }     .main-timeline .timeline:nth-child(even) .timeline-year {     left: 3px;   } }   @media screen and (max-width:567px) {   .main-timeline .title {     font-size: 18px;   } }   .swiper-container {   width: 205px;   height: 500px;   float: left; }   .swiper-slide {   text-align: center;   font-size: 18px;   background: #fff;     /* Center slide text vertically */   display: -webkit-box;   display: -ms-flexbox;   display: -webkit-flex;   display: flex;   -webkit-box-pack: center;   -ms-flex-pack: center;   -webkit-justify-content: center;   justify-content: center;   -webkit-box-align: center;   -ms-flex-align: center;   -webkit-align-items: center;   align-items: center; }   @media (max-width: 760px) {   .swiper-button-next {     right: 20px;     transform: rotate(90deg);   }     .swiper-button-prev {     left: 20px;     transform: rotate(90deg);   } } .event_list img {   width: 880px;   height: 470px;   object-fit: cover; } .xians {   width: 3px;   height: 100%;   background: #0870C5;   position: absolute;   left: 82px;   z-index: -1; }

js:

  <script>     $(function () {       $(".main-timeline .timeline").click(function () {         var TAG = $(this).siblings().length;         if (TAG >= 1) {           var index = $(this).index()           $(this).addClass('fd-active-line').siblings().removeClass('fd-active-line')           $(this).parent().parent().siblings('.event_list').children().eq(index).show().siblings().hide()         }       })       var swiper = new Swiper('.swiper-container', {         slidesPerView: 4,         direction: 'vertical',         navigation: {           nextEl: '.swiper-button-next',           prevEl: '.swiper-button-prev',         },         on: {           resize: function () {             swiper.changeDirection(getDirection());           }         }       });     });   </script>
swiper使用方法

1.首先加載插件,需要用到的文件有swiper-bundle.min.js和swiper-bundle.min.css文件,不同Swiper版本用到的文件名略有不同。可下載Swiper文件或使用CDN。

<link rel="stylesheet" href="dist/css/swiper-bundle.min.css"> <script src="dist/js/swiper-bundle.min.js"></script>

2.HTML內容。

<div class="swiper-container"> 	<div class="swiper-wrapper"> 		<div class="swiper-slide">Slide 1</div> 		<div class="swiper-slide">Slide 2</div> 		<div class="swiper-slide">Slide 3</div> 	</div> 	<!-- 如果需要分頁器 --> 	<div class="swiper-pagination"></div> 	 	<!-- 如果需要導航按鈕 --> 	<div class="swiper-button-prev"></div> 	<div class="swiper-button-next"></div> 	 	<!-- 如果需要滾動條 --> 	<div class="swiper-scrollbar"></div> </div> 導航等組件可以放在container之外

3.你可能想要給Swiper定義一個大小,當然不要也行。

.swiper-container {     width: 600px;     height: 300px; }

4.初始化Swiper。Swiper6之前的默認容器是'.swiper-container',Swiper7以后是'.swiper'。

<script> 	var mySwiper = new Swiper('.swiper-container', { 		direction: 'vertical', // 垂直切換選項 		loop: true, // 循環模式選項  		// 如果需要分頁器 		pagination: { 			el: '.swiper-pagination', 		},  		// 如果需要前進后退按鈕 		navigation: { 			nextEl: '.swiper-button-next', 			prevEl: '.swiper-button-prev', 		},  		// 如果需要滾動條 		scrollbar: { 			el: '.swiper-scrollbar', 		}, 	}) </script>

5.完成。恭喜你,現在你的Swiper應該已經能正常切換了。

如果作為CommonJs 或ES 模塊引入

//CommonJs var Swiper = require('swiper');     var mySwiper = new Swiper('.swiper-container', { /* ... */ });   //ES import Swiper from 'swiper';     var mySwiper = new Swiper('.swiper-container', { /* ... */ });

【推薦學習:jQuery視頻教程、web前端視頻】

贊(0)
分享到: 更多 (0)
?
網站地圖   滬ICP備18035694號-2    滬公網安備31011702889846號
gmnon.cn-疯狂蹂躏欧美一区二区精品,欧美精品久久久久a,高清在线视频日韩欧美,日韩免费av一区二区
性一交一乱一伧国产女士spa| 色婷婷综合在线观看| 一级片黄色免费| 手机在线成人免费视频| 成人免费aaa| 婷婷无套内射影院| 国产精品网站免费| 大j8黑人w巨大888a片| 久久久99精品视频| 国产成a人亚洲精v品在线观看| 国产精品99久久久久久大便| 亚洲女人在线观看| 经典三级在线视频| 黄色片免费在线观看视频| 97av中文字幕| av网站大全免费| 欧美色图色综合| 成人性做爰aaa片免费看不忠| 国产av人人夜夜澡人人爽| 国产成人久久777777| 艹b视频在线观看| 国产又爽又黄ai换脸| 国产精品视频一二三四区| 亚洲高潮无码久久| 国产视频九色蝌蚪| 色www免费视频| 美女av免费观看| 91网址在线播放| 亚洲综合20p| 成人免费观看cn| av在线网址导航| av在线com| 无需播放器的av| 日本a在线天堂| 中文字幕第21页| 黄色a级片免费看| 黄色永久免费网站| 欧美国产综合在线| 超碰在线人人爱| 亚洲国产成人精品无码区99| 国产精品涩涩涩视频网站| 亚洲高清av一区二区三区| 自慰无码一区二区三区| 欧美大片久久久| 无码人妻丰满熟妇区毛片18| 国产精品igao网网址不卡| 99re在线视频免费观看| 亚洲精品国产suv一区88| 国内自拍视频网| heyzo亚洲| 国内自拍中文字幕| www激情五月| 黄色av免费在线播放| 成人午夜视频在线观看免费| 91丝袜超薄交口足| 亚洲综合在线网站| 99精品人妻少妇一区二区| 日本xxxxx18| 婷婷视频在线播放| wwwwwxxxx日本| 亚洲国产精品三区| 欧美日韩在线免费播放| 91专区在线观看| 欧美大黑帍在线播放| 久久av喷吹av高潮av| 九九九九九国产| 天天干天天av| 日本中文字幕二区| 一区二区三区欧美精品| 中文av一区二区三区| 视色视频在线观看| 国产精品人人爽人人爽| 116极品美女午夜一级| 国产网站免费在线观看| 国产3p露脸普通话对白| 欧美极品欧美精品欧美| 黄色片一级视频| 国产 porn| 97超碰人人看| av网站手机在线观看| 日本欧美黄色片| 99蜜桃臀久久久欧美精品网站| 波多野结衣家庭教师在线播放| 国产精品人人妻人人爽人人牛| 簧片在线免费看| 樱花草www在线| 免费拍拍拍网站| 国产免费人做人爱午夜视频| 激情视频免费网站| 国产人妻互换一区二区| 久久亚洲精品无码va白人极品| 精品少妇一区二区三区在线| 国产精品亚洲αv天堂无码| 在线免费观看视频黄| 欧美激情亚洲天堂| 国产91对白刺激露脸在线观看| 自拍偷拍21p| 久久成人福利视频| 男女污污的视频| japanese在线播放| 九色porny91| 日韩国产小视频| 欧美大尺度做爰床戏| 欧美极品少妇无套实战| 日日噜噜噜噜久久久精品毛片| 视频一区二区视频| xxxx一级片| 女人喷潮完整视频| 日本丰满大乳奶| 日韩av片网站| 99福利在线观看| 国产免费内射又粗又爽密桃视频| 久草在在线视频| 国产二区视频在线| 小说区视频区图片区| 国产无套粉嫩白浆内谢的出处| 老司机激情视频| 欧美成人乱码一二三四区免费| 中文字幕无码精品亚洲资源网久久| 992kp免费看片| 无需播放器的av| 国产精品无码av无码| a√天堂在线观看| 久久人人爽人人爽人人av| 亚洲无在线观看| 奇米影视四色在线| 亚洲欧美视频二区| 一本久道中文无码字幕av| www.爱色av.com| 精品视频一区二区在线| 欧美日韩激情视频在线观看| 久久av高潮av| 欧美日韩中文字幕在线播放 | 国产真人做爰毛片视频直播| 日本一区二区三区四区五区六区| 日日干日日操日日射| 欧美三级理论片| 天堂网在线免费观看| 91蝌蚪视频在线观看| 无人在线观看的免费高清视频 | 亚洲欧美一区二区三区不卡| 亚洲综合色在线观看| 艹b视频在线观看| 国产5g成人5g天天爽| 国产盗摄视频在线观看| 台湾无码一区二区| 亚洲一区二区三区av无码| av在线播放亚洲| 日韩免费毛片视频| 亚洲18在线看污www麻豆| 日韩精品在线播放视频| 一本二本三本亚洲码| 岛国大片在线播放| 日韩一级在线免费观看| 香港日本韩国三级网站| 欧美aaa在线观看| www.国产在线播放| caopor在线视频| 秋霞在线一区二区| 成年人观看网站| 亚洲天堂国产视频| www.xxx麻豆| av在线无限看| 国产欧美久久久久| 青青在线免费观看视频| 成人高清在线观看视频| 人人妻人人澡人人爽欧美一区| 免费观看成人在线视频| 992tv成人免费观看| 色婷婷狠狠18| 婷婷五月综合缴情在线视频| 国产成人av影视| 蜜臀av无码一区二区三区| 男女视频在线看| 欧美视频在线免费播放| 国产一二三四五| 九九热免费在线观看| 可以免费观看av毛片| 久久久久久久香蕉| 九一精品久久久| 久久婷婷国产91天堂综合精品| 久久av高潮av| 免费久久久久久| 青青草原播放器| 好男人www社区| 国产性xxxx18免费观看视频| 男人添女荫道口喷水视频| 国产美女视频免费看| 日本a√在线观看| 亚洲精品高清无码视频| 岳毛多又紧做起爽| 91视频最新入口| 很污的网站在线观看| 欧美国产视频一区| 国产精品久久久影院| 99热这里只有精品7| 国产精品久久久久久9999| 高潮一区二区三区| 91女神在线观看| 婷婷中文字幕在线观看|