TA的每日心情 | 难过 2017-7-18 15:02 |
---|
签到天数: 1 天 [LV.1]初来乍到
新手上路
- 积分
- 31
|
在tab切换下嵌套swiper垂直向上循环滚动,到第3个视觉上感觉滚动了一圈,是怎么回事呢,并且不知道怎么描述查找这个问题,有人遇到么?求大神指点,不胜感激!
以下是html里的dom
<div class="score_res">
<p class="score_tit clearfix">
<a class="score_tit1 on" href="javascript:;" title="最新晒分">最新晒分</a>
<a class="score_tit2" href="javascript:;" title="最高晒分">最高晒分</a>
</p>
<div class="score_res_list" style="display:block;">
<ul class="clearfix">
<li class="tab_tit">
<span class="s_name">姓名</span>
<span class="s_stage">学段</span>
<span class="s_subject">学科</span>
<span class="s_city">地区</span>
<span class="s_score">分数</span>
</li>
</ul>
<div class="swiper-container scroll">
<ul class="swiper-wrapper clearfix">
<li class="swiper-slide">
<span class="s_name">张三三</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
<li class="swiper-slide">
<span class="s_name">李四</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
<li class="swiper-slide">
<span class="s_name">谭某某</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
<li class="swiper-slide">
<span class="s_name">王五</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
<li class="swiper-slide">
<span class="s_name">赵六</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
<li class="swiper-slide">
<span class="s_name">周七</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
<li class="swiper-slide">
<span class="s_name">郑八</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
<li class="swiper-slide">
<span class="s_name">孙九</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
<li class="swiper-slide">
<span class="s_name">何十</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
<li class="swiper-slide">
<span class="s_name">金十一</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
</ul>
</div>
</div>
<div class="score_res_list">
<ul class="clearfix">
<li class="tab_tit">
<span class="s_name">姓名</span>
<span class="s_stage">学段</span>
<span class="s_subject">学科</span>
<span class="s_city">地区</span>
<span class="s_score">分数</span>
</li>
</ul>
<div class="swiper-container scroll">
<ul class="swiper-wrapper clearfix">
<li class="swiper-slide">
<span class="s_name">张三三1</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
<li class="swiper-slide">
<span class="s_name">李四</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
<li class="swiper-slide">
<span class="s_name">谭某某</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
<li class="swiper-slide">
<span class="s_name">王五</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
<li class="swiper-slide">
<span class="s_name">赵六</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
<li class="swiper-slide">
<span class="s_name">周七</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
<li class="swiper-slide">
<span class="s_name">郑八</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
<li class="swiper-slide">
<span class="s_name">孙九</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
<li class="swiper-slide">
<span class="s_name">何十</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
<li class="swiper-slide">
<span class="s_name">金十一</span>
<span class="s_stage">中学</span>
<span class="s_subject">数学</span>
<span class="s_city">河北</span>
<span class="s_score">100</span>
</li>
</ul>
</div>
</div>
</div>
以下是jQ
$(function(){
swiperAction();
$('.score_tit').on('click','a',function(){
$(this).addClass('on').siblings().removeClass('on');
var index = $('.score_tit a').index(this);
$('.score_res_list').stop(false,true).hide().eq(index).stop(false,true).show();
swiperAction();
})
$('.scroll').each(function(){
$(this).find('lidd').addClass('odd');
})
})
function swiperAction(){
var mySwiper = new Swiper ('.swiper-container', {
slidesPerView :5,
slidesPerGroup : 1,
speed:300,
autoplay : {
delay:1000
},
loop : true,
direction : 'vertical',
//setWrapperSize :true,
observer:true, //修改swiper自己或子元素时,自动初始化swiper
observeParents:true //修改swiper的父元素时,自动初始化swiper
})
}
tab切换后一行一行向上循环滚动,到第3个的时候滚动速度加快,视觉上感觉滚动了一圈才滚动到下一个,到下一遍的时候依然如此,是什么原因造成的,且要怎么解决呢?
|
|