I am trying to create a full width page slider with one slide to be centered and 2 slides will be partially visible at both sides.
But for some reason there is a big white gap visible. I tried with giving img width 100% but the image resolution is distorting.
Jquery code:
$('.slider').slick({
centerMode: true,
slidesToShow: 1,
slidesToScroll: 1,
dots: true,
infinite: true,
cssEase: 'linear'
});
Demo -- https://jsfiddle.net/squidraj/hn7xsa4y/
Any help is highly appreciated.
A slideshow component for cycling through elements—images or slides of text—like a carousel.
You might want to try using :
$('.slider').slick({
centerMode:true,
slidesToShow: 1,
slidesToScroll: 1,
dots: true,
infinite: true,
cssEase: 'linear',
variableWidth: true,
variableHeight: true
});
This should remove the gap, but you might need to add some css to make sure that the slick <div>
will be large enough to display your whole image. You can also modify the css for the related images.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With