Z
Z
z_u_l2018-10-15 19:09:34
JavaScript
z_u_l, 2018-10-15 19:09:34

How can I make the background image change along with the main slider?

There is an ordinary slider with textual information. How can I make the background image change when changing the slide with text? How to implement this? I use slick-slider.

Slider example

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jupiter Max, 2018-10-15
@vardoLP

well, insert an image into each slide, you can use it as a background

<div class="slide" style="background-image(img/slide.jpg);">
    <div class="text">Тут текст</div>
</div>

there is already a background either specifically in size, or
.slide{
    background-size:cover;
    background-repeat:no-repeat;
    background-position:center top;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question