TA的每日心情 | 怒 2017-9-13 10:56 |
---|
签到天数: 4 天 [LV.2]偶尔看看I
新手上路
- 积分
- 32
|
在双控环路的情况下,点击下面图片的切换,上面轮播图会出现空了一个位置的情况!求大神帮忙看看(如图)
代码如下
- $('.gallery-thumbs').on('click', '.swiper-slide',function(){
- var ind = $(this).index();
- $('.mark-pl').fadeIn();
- $(this).parents('.gallery-thumbs').addClass('active');
- $('.bannerBox').css('top', '122px').addClass('bounceInDown animated');
- galleryThumbs.stopAutoplay();
- });
- $('.btn-close').on('click',function(){
- $('.bannerBox').animate({
- top: -2000,
- },800,function(){
- $('.bannerBox').removeClass('bounceInDown');
- $('.mark-pl').fadeOut();
- });
- galleryThumbs.startAutoplay();
- $('.gallery-thumbs').removeClass('active');
- });
- var galleryTop = new Swiper('.gallery-top', {
- nextButton: '.swiper-button-next',
- prevButton: '.swiper-button-prev',
- spaceBetween : 15,
- pagination : '.swiper-pagination',
- speed: 800,
- loop : true,
- loopAdditionalSlides : 5
- });
- var autop = $('.swiper-pagination span').length > 5 ? 6000 : false;//是否超过5张,5张不自动滚动
- var galleryThumbs = new Swiper('.gallery-thumbs', {
- slidesPerView: '5',
- touchRatio: 0,
- autoplay : autop,
- speed: 800,
- centeredSlides: true,
- slideToClickedSlide: true,
- loop : true,
- loopAdditionalSlides : 1
- });
-
-
- galleryTop.params.control = galleryThumbs;
- galleryThumbs.params.control = galleryTop;
复制代码
|
|