kenwheeler / slick

the last carousel you'll ever need
kenwheeler.github.io/slick
MIT License
28.34k stars 5.88k forks source link

Slideshow instances being swapped, generated slide classes being numbered from 10 not 00 and visa versa, resulting in issues.. #4093

Closed noodlesontoast closed 3 years ago

noodlesontoast commented 3 years ago

I'm having an issue where for some reason per page load my slides are being generated with inconsistent classes.

Usually they will auto generate with class name starting at .slick-slide00, .slick-slide01, slick-slide-02 etc... But on occasion they will be generated starting at #10, so slick-slide10, slick-slide-11, slick-slide12 etc..

I am running two separate slick slideshows on the one page. It appears that each slideshow, with it's classes generated at either 00 or 10 is being swapped, causing the error. When the first slideshow starts at classes starting at 00 everything works. But if this slideshow starts with classes starting at 10, and OTHER with classes starting at 00, then nothing works.

This causes background images for each associated slide to not display. Also, as I am targeting these specific generated slide class names to apply specific attributes per slide this causes many other problems.

This affects the generated .slick-slide-controlXX classes as-well.

Does anybody know what is causing this to happen, or if I can alter the JS to avoid this problem?

Help appreciated, thanks.

====================================================================

Using Firefox, sometimes this will happen when refreshing at an anchor point URL. Currently it's happening on every load when using Chrome, I have cleared cache, history etc.

====================================================================

slick V1.8.0 (listed as 1.8.1 on download, V1.8.0 in slick.js

====================================================================

noodlesontoast commented 3 years ago

The issue was the order of the two slideshow instances in my scripts.js file (second slideshow came first in scripts.js), Chrome must handle this differently than Firefox.