JS code doesn't work on a loop or duplicate tags


I am trying to have multiple cards with a “read more” button to a swiper and when I duplicate the cards-slides or loop them, the JS code doesn’t work on all the looped-duplicated cards except the first card.

Please check the problem.


That script needs a bit of re-coding to work on all of them correctly. I can do it for you tonight

1 Like

Do you mean that any JS code has to be written differently if it needs to be used in a loop or duplicated?

Can the re-coding be possible for other JS codes as well?

I would like to know how can I learn to re-code JS codes for loops in general so I will not bug you with it every time.

Spasibo maestro :pray:

Hi Stefan,

Do you have the code for me?

Have a good week.

I edited that for you, should be all good now