A
A
Alexander592017-09-20 12:46:10
css
Alexander59, 2017-09-20 12:46:10

How to make a second slider?

How to make a second slider with thumbnails on the page? I use
Thumbs Gallery With Two-way Control
idangero.us/swiper/demos/#.WcIqADMY5TY
For simplicity, I took out the code in jsfiddle.
I tried to add 2 at the end and copy css and js with new names in the classes - it does not help.
The slider author page only lists the placement of the 2nd normal slider, not the thumbnail slider.
This is how the author invokes the second and third regular carousels

<!-- Initialize Swiper -->
    <script>
    var swiper1 = new Swiper('.swiper1', {
        pagination: '.swiper-pagination1',
        paginationClickable: true,
        spaceBetween: 30,
    });
    var swiper2 = new Swiper('.swiper2', {
        pagination: '.swiper-pagination2',
        paginationClickable: true,
        spaceBetween: 30,
    });
    var swiper3 = new Swiper('.swiper3', {
        pagination: '.swiper-pagination3',
        paginationClickable: true,
        spaceBetween: 30,
    });
    </script>

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Mikhail Lyalin, 2019-06-05
@mr_jok

https://jsfiddle.net/7fjSc/9/ and similar to CSS wave search

A
Alex Glebov, 2019-06-05
@SkiperX

pseudo with picture
5cf7cc7ebf47f146718810.jpeg

O
one_day, 2017-09-20
@Alexandr59

css
html, body {
        position: relative;
        height: 100%;
    }
    body {
        background: #fff;
        font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
        font-size: 14px;
        color:#000;
        margin: 0;
        padding: 0;
    }
    .swiper-container2,
    .swiper-container {
        width: 40%;
        height: 300px;
        margin-left: auto;
        margin-right: auto;
    position: relative;
    overflow: hidden;
    z-index: 1;
    }
    .swiper-slide2,
  .swiper-slide {
        background-size: cover;
        background-position: center;
    }
    .gallery-top2,
    .gallery-top {
        height: 40%;
        width: 50%;
    }
    .gallery-thumbs2,
    .gallery-thumbs {
        height: 20%;
        box-sizing: border-box;
        padding: 10px 0;
    }
    .gallery-thumbs2 .swiper-slide,
    .gallery-thumbs .swiper-slide {
        height: 100%;
        opacity: 0.4;
    }
    .gallery-thumbs2 .swiper-slide-active,
    .gallery-thumbs .swiper-slide-active {
        opacity: 1;
    }
js
var galleryTop = new Swiper('.gallery-top', {
        nextButton: '.swiper-button-next',
        prevButton: '.swiper-button-prev',
        spaceBetween: 10,
        loop:true,
        loopedSlides: 5, //looped slides should be the same     
    });
    var galleryThumbs = new Swiper('.gallery-thumbs', {
        spaceBetween: 10,
        slidesPerView: 4,
        touchRatio: 0.2,
        loop:true,
        loopedSlides: 5, //looped slides should be the same
        slideToClickedSlide: true
    });
 var galleryTop2 = new Swiper('.gallery-top2', {
        nextButton: '.swiper-button-next',
        prevButton: '.swiper-button-prev',
        spaceBetween: 10,
        loop:true,
        loopedSlides: 5, //looped slides should be the same     
    });
    var galleryThumbs2 = new Swiper('.gallery-thumbs2', {
        spaceBetween: 10,
        slidesPerView: 4,
        touchRatio: 0.2,
        loop:true,
        loopedSlides: 5, //looped slides should be the same
        slideToClickedSlide: true
    });   
    
    galleryTop.params.control = galleryThumbs;
    galleryThumbs.params.control = galleryTop;
    galleryTop2.params.control = galleryThumbs2;
    galleryThumbs2.params.control = galleryTop2;

give yourself an example

A
Andrew, 2017-09-20
@AndrewHaze

Try adding a second slider via<iframe>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question