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

How to add more sliders on one page? #36

Open
ysnitko opened this issue Jan 12, 2023 · 1 comment
Open

How to add more sliders on one page? #36

ysnitko opened this issue Jan 12, 2023 · 1 comment

Comments

@ysnitko
Copy link

ysnitko commented Jan 12, 2023

Hi. How to add more sliders on one page?
If you just copy and paste the same html code, then only the first slider works.

@mmdevcodes
Copy link
Owner

@fjord20 Select all your sliders and then iterate over the list:

const sliders = document.querySelectorAll('.slider');

sliders.forEach(sliderEl => {
   const slider = new A11YSlider(sliderEl);
});

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

2 participants