G
G
Greeg Zagrelov2020-05-04 14:46:27
css
Greeg Zagrelov, 2020-05-04 14:46:27

How to set swiper height?

Hello, can you tell me how to set the height?
https://swiperjs.com/api/ poofed here but something I'm blind (

var swiper = new Swiper('.swiper-container-sub', {
    // slidesPerView: 4,
    // spaceBetween: 30,
    slidesPerGroup: 1,
    loop: true,
    loopFillGroupWithBlank: true,

    spaceBetween: 10,
    pagination: {
        el: '.swiper-pagination',
        clickable: true,
    },
    navigation: {
        nextEl: '.swiper-button-n',
        prevEl: '.swiper-button-b',
    },
    breakpoints: {
        // when window width is >= 320px
        320: {
            slidesPerView: 1,
            spaceBetween: 20
        },
        // when window width is <= 480px
        480: {
            slidesPerView: 1,
            spaceBetween: 30
        },
        // when window width is >= 640px
        640: {
            slidesPerView: 2,
            spaceBetween: 40
         
        }
    }
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
wyzemind, 2020-05-04
@OldSchool1705

Why do it with a script? Set the height of the desired block via css, if necessary.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question