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

站長資訊網(wǎng)
最全最豐富的資訊網(wǎng)站

jquery+swiper實現(xiàn)時間軸tab滑動切換顯示效果

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

jquery+swiper實現(xiàn)時間軸tab滑動切換顯示效果

前端(vue)入門到精通課程:進(jìn)入學(xué)習(xí)

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

實現(xiàn)思路:

結(jié)合swiper插件實現(xiàn)滑動顯示效果

根據(jù)transform: translateX進(jìn)行左側(cè)切換效果的實現(xiàn)(具體實現(xiàn)css如下),實現(xiàn)非滾動的點擊切換效果,結(jié)合swiper進(jìn)行修改。【相關(guān)教程推薦:jQuery教程】

實現(xiàn)效果:

jquery+swiper實現(xiàn)時間軸tab滑動切換顯示效果

實現(xiàn)代碼:需要配合swiper組件使用;左側(cè)導(dǎo)航是根據(jù)html結(jié)構(gòu)和css3代碼,來生成的時間軸效果效果來源于http://www.htmleaf.com/css3/ui-design/201911275850.html

Swiper基礎(chǔ)演示地址: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內(nèi)容。

<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> 	 	<!-- 如果需要導(dǎo)航按鈕 --> 	<div class="swiper-button-prev"></div> 	<div class="swiper-button-next"></div> 	 	<!-- 如果需要滾動條 --> 	<div class="swiper-scrollbar"></div> </div> 導(dǎo)航等組件可以放在container之外

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

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

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

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

5.完成。恭喜你,現(xiàn)在你的Swiper應(yīng)該已經(jīng)能正常切換了。

如果作為CommonJs 或ES 模塊引入

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

【推薦學(xué)習(xí):jQuery視頻教程、web前端視頻】

贊(0)
分享到: 更多 (0)
?
網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號
gmnon.cn-疯狂蹂躏欧美一区二区精品,欧美精品久久久久a,高清在线视频日韩欧美,日韩免费av一区二区
天天摸天天舔天天操| 国产中文字幕二区| 成人在线免费播放视频| 久久艹国产精品| 国产性生活一级片| 午夜免费看视频| 亚洲成人av免费看| 欧美伦理片在线看| 亚洲成人福利在线观看| 精品99在线视频| 欧美综合在线观看视频| 情侣黄网站免费看| www.亚洲天堂网| wwww.国产| 午夜视频在线观| 男插女免费视频| 特级西西444| 蜜臀av性久久久久蜜臀av| av动漫在线播放| 国产69精品久久久久999小说| 国产尤物av一区二区三区| 国产a级片网站| 青青视频在线播放| 日日噜噜噜噜久久久精品毛片| www.色偷偷.com| 九九九久久久久久久| 大桥未久一区二区| 日本丰满少妇xxxx| 天天干在线影院| 天天操天天干天天玩| 日韩国产成人无码av毛片| 日韩欧美精品在线观看视频| 国产精品久久久毛片| 国产四区在线观看| 国产美女无遮挡网站| 午夜视频在线网站| 搞av.com| 久久精品一卡二卡| 国产a级一级片| 99亚洲精品视频| 国产日韩一区二区在线| 色中文字幕在线观看| 久久精品免费一区二区| 91看片破解版| 免费激情视频在线观看| 一级黄色片播放| 男人天堂成人在线| 青草视频在线观看视频| 中文字幕一区久久| 欧美伦理片在线看| 青青草视频在线免费播放| 亚洲一二三不卡| 欧美婷婷精品激情| 成人精品视频一区二区| 精品一区二区三区无码视频| 日本不卡一区二区在线观看| 欧美日韩国产精品激情在线播放| 亚洲国产精品影视| 日本中文字幕观看| www.色就是色| 国产1区2区在线| 国产h视频在线播放| 手机在线观看日韩av| 亚洲 国产 图片| 亚洲成人av免费看| 情侣黄网站免费看| 免费裸体美女网站| 欧美久久久久久久久久久久久久| 两性午夜免费视频| 高清av免费看| 成人性生交免费看| 日本国产一级片| 一区二区三区四区毛片| 久久久久久综合网| 午夜精品久久久久久久99热影院| 九一精品在线观看| 手机av在线网| 亚洲色图欧美自拍| 国产精欧美一区二区三区白种人| 亚洲午夜激情影院| 成人免费黄色av| 99re6这里有精品热视频| 日本国产中文字幕| 日韩欧美亚洲天堂| 久久精品一区二| 777一区二区| av动漫在线免费观看| 国产一线二线三线女| 欧美日韩性生活片| 污污的网站18| 成年人网站av| 成年人午夜免费视频| 黄色三级视频在线| 亚洲一区二区中文字幕在线观看| www.99riav| 免费男同深夜夜行网站| 视频免费1区二区三区| 久久av综合网| 波多野结衣xxxx| 丰满人妻一区二区三区53号| 91猫先生在线| 一级日本黄色片| 国产成人久久777777| 99re99热| 天天爽天天爽夜夜爽| 国产青草视频在线观看| 国产日韩成人内射视频 | 国产 日韩 欧美在线| 日韩爱爱小视频| 男人日女人逼逼| 永久免费看av| 九色porny自拍| 黄色动漫网站入口| 少妇久久久久久被弄到高潮| 国产精品入口免费软件| 久久久性生活视频| 欧美h视频在线观看| 亚洲欧美激情网| 黄色免费观看视频网站| 激情视频小说图片| 日韩成人av免费| 欧美伦理片在线观看| 国产91在线免费| 久久久天堂国产精品| jizz18女人| 九九热在线免费| 亚洲精品高清无码视频| 国产视频九色蝌蚪| 日本十八禁视频无遮挡| 日韩视频 中文字幕| 樱空桃在线播放| 欧美日韩亚洲国产成人| 国产乱码一区二区三区四区| 91看片在线免费观看| 人人爽人人av| 中文字幕永久视频| gai在线观看免费高清| www.cao超碰| 五月天丁香花婷婷| 欧美少妇一级片| 国产内射老熟女aaaa| 欧美 日韩 亚洲 一区| 日本一区二区黄色| 欧美精品一区二区三区免费播放| 成人亚洲视频在线观看| 国产精品区在线| 婷婷视频在线播放| 97超碰在线人人| 亚洲精品一二三四五区| 黄色三级视频在线播放| av 日韩 人妻 黑人 综合 无码| 国产精品日韩三级| 国产女大学生av| xx欧美撒尿嘘撒尿xx| 精品日韩在线播放| 热99这里只有精品| 亚洲另类第一页| 成人一级生活片| 黄色国产小视频| 国产亚洲黄色片| 99热这里只有精品在线播放| www.偷拍.com| 日韩视频免费播放| 亚洲免费999| 国产激情在线看| 男人日女人逼逼| 国产黑丝在线视频| 999在线观看视频| 国产一区二区在线免费播放| 久久久国产欧美| 警花观音坐莲激情销魂小说| 日韩欧美猛交xxxxx无码| 大肉大捧一进一出好爽视频| 国产男女无遮挡| 九一精品久久久| 亚洲爆乳无码精品aaa片蜜桃| 日韩中文字幕亚洲精品欧美| 狠狠热免费视频| 91传媒免费视频| 九色porny91| 红桃av在线播放| 三级一区二区三区| 免费看黄在线看| gogogo免费高清日本写真| 国产人妻777人伦精品hd| 天美星空大象mv在线观看视频| 亚洲一级片免费观看| 六月丁香婷婷在线| 4444在线观看| www.99av.com| 日韩精品你懂的| 玩弄中年熟妇正在播放| 最新天堂中文在线| 国产一区二区三区乱码| 亚洲综合欧美激情| 日本www在线视频| 中文字幕22页| 欧美国产日韩在线视频| 在线免费视频a| 37pao成人国产永久免费视频|