C
C
Clear-sky2021-05-05 15:23:19
css
Clear-sky, 2021-05-05 15:23:19

How to style individual blocks in a carousel in javascript?

https://jsfiddle.net/Vikkelas/L9kqhy74/19/

There is such a slider - tell me the algorithm for solving: you need to style the content of the slider so that the visible area of ​​​​the three sliders shows the signature only for the central one, that is, there were only pictures on the sides and in center picture with captions!? is it possible to add this code somehow?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-05-05
@Clear-sky

add the hidden attribute to all links with the description-product class

items.forEach((item) => {
    item.style.minWidth = `${itemWidth}px`;
    item.querySelector('.description-product').hidden = true;
});

and remove it only where you need to show the description (hidden = false), that is, for the central image

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question