Splidejs / splide

Splide is a lightweight, flexible and accessible slider/carousel written in TypeScript. No dependencies, no Lighthouse errors.
https://splidejs.com
MIT License
4.89k stars 424 forks source link

Mistake in thumbnail carousel tutorial #1196

Open Markus0020 opened 1 year ago

Markus0020 commented 1 year ago

Checks

Version

4

Description

On final code of the tutorial the following lines

main.sync( thumbnails ); main.mount(); thumbnails.mount();

should be changed to:

thumbnails.mount(); main.sync(thumbnails); main.mount();

Otherwise an error occurs: [SPLIDE] Cannot read properties of null (reading 'Elements') error @ splide.esm.js:882

The thumbail-carousel should be mounted first before the main slider can be synchronized with it.

Reproduction Link

https://splidejs.com/tutorials/thumbnail-carousel/

Steps to Reproduce

/

Expected Behaviour

[SPLIDE] Cannot read properties of null (reading 'Elements')