:'(:'( |
:Q:Q:Q:Q |
on:{ slideChangeTransitionEnd:function(){ var parent0 = document.getElementById('parent1'); var child0 = document.getElementById('child1'); var child_w = child0.offsetHeight; var parent_w = parent0.offsetHeight; if(this.realIndex==1) //当跳档第2个的时候检查一下是否需要轮播 { //如果存在滚动条 if (parent_w >= child_w) { //如果不需要轮播 window.clearInterval(timer); timer = null; mySwiper.autoplay.start(); } else{ //如果有滚动条 parent0.scrollTop = 0; mySwiper.autoplay.stop(); setScroll(); } }else{ if(timer) { window.clearInterval(timer); } } }, }, |
<div class="swiper-wrapper"> <div class="swiper-slide">01<img src="../static/01.png"/></div> <div id="parent1" class="parent swiper-slide"> <div id="child1" class="child"> <li>1</li> <li>2</li> <li>3</li> <li>4</li> <li>5</li> <li>6</li> <li>7</li> <li>8</li> <li>9</li> <li>10</li> </div> </div> <div class="swiper-slide">02<img src="../static/02.png"/></div> </div> |
Archiver|手机版|小黑屋|Swiper中文网 ( 粤ICP备15001020号 )
GMT+8, 2025-1-15 19:35 , Processed in 0.061964 second(s), 31 queries .
Powered by Discuz! X3.2
© 2001-2013 Comsenz Inc.