Slick: Showing the last item half off the screen

Created on 30 Jan 2015  路  12Comments  路  Source: kenwheeler/slick

Hi I have a multiple carousel which has no arrows or dots and I would like to indicate there are more items by showing an item half hidden on the right side. Do you have any suggestions for doing this? Thanks

Most helpful comment

Late answer, but this is easily achievable by writing something similar to this in the slider settings:
slidesToShow: 3.3,

All 12 comments

Center mode does this pretty well

Thanks will check that out

In case anyone comes across this, center wasn't right for me so this is what I did:

// options
onSetPosition: this.onSetPosition

// a method/func
onSetPosition: function() {
    if (this.$slides.length > this.options.slidesToShow) {
        // Note: don't use this.slideWidth for this.
        var slideWidth = this.$slides.first().width();
        var addValueToEach = (slideWidth / 2) / this.options.slidesToShow;
        this.$slides.width(slideWidth + addValueToEach);
    }
}

@DominicTobias I'm looking to produce the same effect, but I assume your solution would only work if you have an infinite scroll. Otherwise won't the last item always be cut off?

@blackatlmbrjck I'm not sure actually, shortly after the client decided to have carousel arrows so I removed this. I don't remember it being broken but not sure!

Late answer, but this is easily achievable by writing something similar to this in the slider settings:
slidesToShow: 3.3,

@CarlFredrik This centers it, same effect as if u used centerMode: true.... How to make only next item slightly show

@CarlFredrik THANK YOU !!!!!!!!!!

@CarlFredrik PERFECT!!!!!! tks

Both solutions work OK, but is there a way to not cut the first slide? It's cutting off both first and last slides.

[UPDATE]
I set infinite: false and it worked :-)

Both solutions work OK, but is there a way to not cut the first slide? It's cutting off both first and last slides.

[UPDATE]
I set infinite: false and it worked :-)

Thanks @kenold . What should I do if I need infinite to be true?

This thread saved me so much time; thank you!

Was this page helpful?
0 / 5 - 0 ratings