kenwheeler / slick

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

not showing until i click next, or change window size #4232

Open Rmdhn1 opened 1 year ago

Rmdhn1 commented 1 year ago

had a pretty similar problem to this guy, https://stackoverflow.com/questions/31955382/slick-carousel-has-0px-width-when-loaded-in-collapsed-tab

but slick('setPosition'); is just not working, i try using it on inspect console first to test before adding to my site, and it returns

Uncaught TypeError: Cannot read properties of undefined (reading 'setPosition')
    at e.fn.slick (ultp.min.js?ver=2.8.5:1:49854)
    at <anonymous>:1:1

why? i tried using id, i tried using class, everything! it just won't work

y00n-lee commented 1 year ago

I think your dom element is undefined. check your element exist and find it on console first.