Tiny-slider: Multi sliders with the same class name

Created on 22 Feb 2018  路  2Comments  路  Source: ganlanyuan/tiny-slider

When I put multi div with the same slider container class, it works for the first div only.
Not all DIVS becomes sliders.

duplicate

Most helpful comment

Here is the solution for this issue:

const tnsCarousel = document.querySelectorAll('.tns-slider');
tnsCarousel.forEach(slider => {
      const tnsSlider = tns({
           container: slider,                   
      });
});

When I put multi div with the same slider container class, it works for the first div only.
Not all DIVS becomes sliders.

All 2 comments

Same as #103

Here is the solution for this issue:

const tnsCarousel = document.querySelectorAll('.tns-slider');
tnsCarousel.forEach(slider => {
      const tnsSlider = tns({
           container: slider,                   
      });
});

When I put multi div with the same slider container class, it works for the first div only.
Not all DIVS becomes sliders.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

b3nhartl3y picture b3nhartl3y  路  3Comments

CristianEstiber picture CristianEstiber  路  3Comments

matheusgrieger picture matheusgrieger  路  3Comments

DuckThom picture DuckThom  路  5Comments

movationdesign picture movationdesign  路  5Comments