成人怡红院-成人怡红院视频在线观看-成人影视大全-成人影院203nnxyz-美女毛片在线看-美女免费黄

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

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

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

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

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

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

實現(xiàn)思路:

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

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

實現(xiàn)效果:

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

實現(xiàn)代碼:需要配合swiper組件使用;左側導航是根據(jù)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內(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> 	 	<!-- 如果需要導航按鈕 --> 	<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, // 循環(huán)模式選項  		// 如果需要分頁器 		pagination: { 			el: '.swiper-pagination', 		},  		// 如果需要前進后退按鈕 		navigation: { 			nextEl: '.swiper-button-next', 			prevEl: '.swiper-button-prev', 		},  		// 如果需要滾動條 		scrollbar: { 			el: '.swiper-scrollbar', 		}, 	}) </script>

5.完成。恭喜你,現(xiàn)在你的Swiper應該已經(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', { /* ... */ });

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

贊(0)
分享到: 更多 (0)
?
網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號
日韩精品无码一本二本三本色| 日本熟妇色熟妇在线视频播放 | 被猛男房东CAO到哭H| YY6080久久亚洲精品| 超碰成人人人做人人爽| 国产AV无码国产AV毛片| 国产手机在线ΑⅤ片无码观看| 狠狠色综合久久丁香婷婷| 久久99精品久久只有精品| 老师粉嫩小泬喷水视频90| 女人两个奶被揉到高潮就不想了| 人妻无码精品久久亚瑟影视| 淑芬二腿间又痒了| 亚洲AV无码AV制服另类专区| 亚洲无日韩码精品 | 麻豆一区二区三区蜜桃免费| 欧美最猛黑人XXXX黑人猛交| 熟妇女领导呻吟疯狂| 亚洲AV无码成电影在线播放| 伊人久久大香线蕉AV五月天宝贝| JIZZJIZZJIZZ亚洲熟| 国产成人无码区免费内射一片色欲 | 国产精品国产三级国快看| 国产又爽又粗又猛的视频| 久久天天躁狠狠躁夜夜不卡| 秋霞无码AⅤ一区二区三区| 天天爱天天做天天爽| 亚洲韩国精品无码一区二区三区 | 无套内射无矿码免费看黄| 亚洲欧洲∨国产一区二区三区 | 欧美Z0ZO人禽交| 特级AAAAAAAAA毛片免费| 亚洲精品V天堂中文字幕| 69久久夜色精品国产69| 国产99久9在线 | 传媒| 极品呦女JAPANESE| 女被啪到高潮的GIF动态图无遮| 日日噜噜夜夜爽爽| 亚洲国产丝袜精品一区| MM1313亚洲精品无码又大又| 国产精品污WWW一区二区三区| 久久精品伊人一区二区三区 | 久久不见久久见WWW免费| 欧美日韩综合精品一区二区| 无码人妻AⅤ一区二区三区| 夜夜躁天天躁很很躁| 超碰97人人做人人爱可以下载 | 亚洲 日韩 丝袜 熟女 变态| 中文一国产一无码一日韩| 国产成人久久777777| 两根硕大一起挤进小紧H共妻| 色欲香天天综合网站| 亚洲字幕AV一区二区三区四区| 暗交拗女一区二区三区| 精东传媒VS天美传媒在线| 欧美ZC00O人与善交| 性色AV一区二区三区天美传媒| 中国毛茸茸性XXXX| 国产精华液一线二线三线| 免费观看羞羞的事情网站| 无码国产精品一区二区免费久久 | 办公室的交易完整版| 黑料不打烊隐藏入口GITHUB| 人妻AV中文系列| 亚洲精品无码专区久久久| 成人免费A级毛片免费| 久久精品人成免费| 少妇午夜啪爽嗷嗷叫视频| 又大又粗又爽ΑA级毛片 | 我国产码在线观看AV哈哈哈网站| 中文字幕乱码亚洲无线码三区| 国产又黄又大又粗视频| 让人一看就舒服的网名| 亚洲色偷偷AV男人的天堂| 国产成人久久精品一区二区三区| 奶头好大揉着好爽视频午夜院| 亚洲AV无码一区二区二三区下载 | 日韩在线 | 中文| 在线观看国产精选免费| 国产无遮挡又黄又爽免费视频| 人妻无码AⅤ不卡中文字幕| 夜里18款禁用B站入APP软件| 国产精品怡红院在线观看| 亲近相奷对白中文字幕片| 亚洲中文字幕无码中文字| 国产精品爽爽VA在线观看| 强插女教师AV在线| 伊人色综合视频一区二区三区 | 苍井空浴缸大战猛男120分钟 | 中文字幕人妻三级中文无码视频 | 亚洲AV无码专区在线电影天堂 | 中文字幕人妻成人综合永久| 狠狠色噜噜狠狠狠狠888奇禾| 少妇人妻综合久久中文字幕| A级毛片免费网站| 久久水蜜桃亚洲AV无码精品| 亚洲а∨天堂男人色无码蜜臀69| 国产WW久久久久久久久久| 欧美兽交YOYO| 在线精品国产成人综合| 精品人妻少妇AV一区二区三区| 无码精品久久久久久人妻中字| 差差差很疼30分钟视频| 女人18毛片A级毛片视频| 亞洲成AV無碼人在線觀看| 黑人大战中国AV女叫惨了| 玩弄放荡人妇系列AV在线网站| 成人无码区免费AⅤ片在线观看| 母亲とが话しています播放| 一区二区在线 | 欧洲| 精品9E精品视频在线观看| 午夜精品久久久久久毛片| 绯色AV一区二区三区蜜臀| 人妻精品一区二区| ACTION对魔忍| 猫咪AV成人永久网站| 一区二区精品视频| 久久久久成人精品| 亚洲精品无码专区| 激情综合色综合久久综合| 亚洲AⅤ天堂无码专区-百度| 国产乱AⅤ一区二区三区| 四虎精品成人免费视频| 高清国产天干天干天干| 日产无人区一线二线三线最新版| А√天堂8资源中文在线| 欧洲无人区码SUV| H漫无码动漫AV动漫在线播放| 欧美激情性XXXXX高清真| 99精品国产兔费观看久久 | 娇妻借朋友高H繁交H| 亚洲AV中文无码乱人伦在线R| 国精产品一品二品国精| 亚洲AV成人无码网站大全| 国产在线超清日本一本| 亚洲AV伊人久久青青草原| 好爽毛片一区二区三区四| 亚洲国产精品一区二区久久| 黑人粗大猛烈进出高潮视频| 亚洲乱码一卡二卡四卡乱码新区| 精品无人区卡一卡二卡三| 亚洲日韩AV无码一区二区三区人| 久久成人成狠狠爱综合网| 一边摸一边吃奶一边做爽| 伦人伦XXXX国语对白| 中文字幕在线观看亚洲日韩| 女人夜夜春高潮爽A∨片| AV无码中文字幕不卡一区二区三| 欧美性爱视频第一页| 草草浮力院禁止18进入| 少女たちよ观看动漫| 国产精品无码电影在线观看| 亚洲AV无码一区二区三区蜜桃| 精品第一国产综合精品AⅤ| 亚洲综合一区国产精品| 妺妺窝人体色WWW网| 锕锕锕锕锕锕~好深啊电影APP| 日韩日韩日韩日韩 日韩 日韩 | 精品韩国AV无码一区二区三区| 亚洲中文字幕久久无码精品| 免费下载破解看片APP的软件| GOGO人体大胆瓣开下部L| 色婷婷五月综合激情中文字幕| 国产精品久久成人网站| 亚洲JIZZJIZZ中国少妇| 老狼一区忘忧草欢迎您大豆| FREE性欧美高清VIDEOS| 少妇高潮惨叫久久久久电影69| 国产精品一国产精品| 亚洲精品国产一区二区三区在线观| 久青草国产97香蕉在线影院| AV网站免费线看| 丝袜 亚洲 另类 欧美 变态| 韩国亚洲精品a在线无码| 曰曰摸天天添天天湿| 人妻少妇无码一区二区三区| 国产成人久久AV免费高潮| 亚洲国产AV一区二区三区| 美女黑人做受XXXXXⅩ性| 菠萝蜜一线二线三线品牌| 午夜.DJ高清在线观看免费7| 久久久久久毛片精品免费不卡| VIDEOSSEX变态狂另类| 无码人妻精品中文字幕免费| 久久WWW免费人成_网站| CAOPOREN个人免费公开| 婷婷四房综合激情五月在线| 久久精品国产一区二区无码 | 欧美色欧美亚洲另类二区| 国产精品久久久久久久久久久不卡| 亚洲熟妇无码av叧娄本色| 全免费A级毛片免费看网站| 国产精品主播一区二区三区| 伊人AV超碰伊人久久久| 日韩精品一区二区三区中文无码 | 亚洲卡5卡6卡7卡2021入口| 欧美老熟妇XOXOXOⅩO| 国产免费无遮挡吃奶视频| 2020久久天天躁狠狠躁夜夜 | 欧美日韩乱一区二区三区|