Slick: slidesToShow not working?

Created on 16 May 2018  路  3Comments  路  Source: kenwheeler/slick

short description of the bug / issue, provide more detail below.

Tried using slidesToShow setting - doesn't work? auto adjusts width but doesn't show X amount of slides.

Steps to reproduce the problem

Here is my code (no jsfiddle as generated with PHP):

jquery:

$('.product-gallery').slick({
    arrows: false,
    fade: true,
    infinite: true,
    slidesToShow: 4,
    slidesToScroll: 1
});

php/html:

<?php if (count($product_gallery_slides) > 0) : ?>
    <div class="product-gallery">
        <?php foreach ($product_gallery_slides as $slide) : ?>
            <div>
                <img src="<?php echo plugins_url('path/to/images/'). $slide->slide_img; ?>"
                     alt="<?php echo $info->model_name; ?> Slider" />
            </div>
        <?php endforeach; ?>
    </div>
<?php endif; ?>

====================================================================

What is the expected behaviour?

... to show 4 slides at once

====================================================================

What is observed behaviour?

... it shows one result

====================================================================

More Details

  • Which browsers/versions does it happen on?
    Linux Mint Firefox

  • Which jQuery/Slick version are you using?
    jQuery - 3.21.1
    can't find my download link I used (new OS so data lost)

  • Did this work before?
    Not sure - hadn't tried

Most helpful comment

Can't use fade : true it seems..

All 3 comments

I fixed using:

    $('.product-gallery').slick({
        arrows:         false,
        autoplay:       true,
        autoplaySpeed:  4500,
        infinite:       true,
        pauseOnFocus:   false,
        pauseOnHover:   false,
        slidesToShow:   4,
        slidesToScroll: 1
    });

please close :)

Can't use fade : true it seems..

You could but only with slidesToShow: 1 for now

Was this page helpful?
0 / 5 - 0 ratings