Slick Slider "eats" a built-in slide styles. What to do?

0 like 0 dislike
40 views
The problem in adapting of slider to mobile devices. The fact that the slide background-img is set to an inline style.

Respectively added in JS the necessary breakpoints for resizing the slider. So, inline styles, that is, the background picture disappears after rebuilding the slider. What I do not understand. I would appreciate the help. Thank you.

Distribute an example! https://codepen.io/Nadinsan/pen/zjoJBB
by | 40 views

1 Answer

0 like 0 dislike
2 simple solutions:
1) Assign each slide a unique class (e.g., slide-1, slide-2, etc.) that will be transmitted picture. If all the image's url is known in advance, it is possible to send the file with styles. If not, then add to the page in .
2) Add in each .slide the nested div, which assign a background-image.
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
33,912 users