Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add class to visible items #261

Open
ghost opened this issue Jan 6, 2020 · 1 comment
Open

Add class to visible items #261

ghost opened this issue Jan 6, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented Jan 6, 2020

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!

@hugoburguete
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant