Answer the question
In order to leave comments, you need to log in
How to make click work correctly?
Hello.
I have many .rout-item elements and on click on each one, certain events should occur with it.
But these events happen to absolutely all .rout-item
Here is what I tried to do, nothing comes out. What to do?
codepen.io/Zuraavl/pen/QjqMVa
$('.rout-item').click(function (e) {
$('.rout-item').removeClass("active");
$(this).addClass("active");
$('.rout-details').slideDown();
$('.rout-controls').slideDown();
});
Answer the question
In order to leave comments, you need to log in
Presumably ALL $('.rout-details') and ALL $('.rout-controls') are shown.
You need to find one that should be shown, and the rest should be collapsed.
But without an HTML example, it's impossible to answer.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question