How to make a loop in javascript?

I have such code:
$('.product-thumbs-nav.slider_custom1 > div').click(function() {
$(this).addClass('active');
 $('.product-thumbs-nav.slider_custom1 > div').not($(this)).removeClass('active');
$('.product-photo-slider.slider_custom1').slick('slickGoTo',$(this).index());
});
$('.product-thumbs-nav.slider_custom2 > div').click(function() {
$(this).addClass('active');
 $('.product-thumbs-nav.slider_custom2 > div').not($(this)).removeClass('active');
$('.product-photo-slider.slider_custom2').slick('slickGoTo',$(this).index());
});

Changes here nothing .slider_custom. Tried to enter a variable, but I do not understand where in this case det '> div'

How to make this an infinite loop?
June 3rd 19 at 21:03
0 answer

Find more questions by tags JavaScriptCSSjQuery