Faced a problem (question).
I have a fairly simple action when I click on an element:
$(document).on('click', '.add-plus-btn.transition_1', function() { $(this).fadeOut(0); $('.add-transition.transition_1').fadeIn(250); }); $(document).on('click', '.add-plus-btn.transition_2', function() { $(this).fadeOut(0); $('.add-transition.transition_2').fadeIn(250); }); // И так до transition_60 элементов (может быть по разному); How can I simplify the code, maybe with a for loop? But it does not work ...
Thank!
.add-plus-btnand use this inside? True strange somehow fadeOut and immediately fadeIn on the same element - Alexey Shimanskytransition_*classes is present for this, if it has several of them - Grundy