N
N
Nazaror2020-03-16 11:08:02
JavaScript
Nazaror, 2020-03-16 11:08:02

How to make a card in a slider?

You need to make a slider with reviews like this block. But the problem is that when I insert this block there, the flexes in the slider do not work. How can I implement this? Or do you need a different slider?

spoiler
5e6f33de8511e422482664.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
0
0xD34F, 2019-08-12
@SecurityYourFingers

Replace id with data attribute:

$('[data-index]').click(function() {
  $('#main__display').html(`<img src="${collect[this.dataset.index]}">`);
});

P
Philip Gaponenko, 2019-08-12
@filgaponenko

Here you can not hang a handler on each of the elements, but use event delegation - instead of many handlers, hang one handler on the parent.
This will allow you not to hang handlers again when adding new elements and not to worry about removing handlers from memory when deleting elements.

E
Eugene, 2020-03-16
@iamd503

Need to learn css

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question