siema icon indicating copy to clipboard operation
siema copied to clipboard

Add class to visible items

Open ghost opened this issue 5 years ago • 1 comments

Hi there! I am struggling to add a class to the current slides if you have multiple items enabled. So far I found something like this:

function currentSlide() {
    $('.item').removeClass('current');
    $('.siema').find('.item').eq(this.currentSlide).addClass('current');
}
onInit: currentSlide,
onChange: currentSlide,	

But this only adds the current class to one item. Since I am using a carousel with 3 items visible at once, I need to add the class to all of the items (which are visible). Is this possible? Thanks in advance!

ghost avatar Jan 06 '20 14:01 ghost

Can you not find the item per index and loop through this.perPage?

hugoburguete avatar Feb 11 '20 12:02 hugoburguete