There are several groups of blocks lined up in rows. For example, two rows of three blocks.
Under each block there is some textual content that must be hidden / shown when clicking on a block.
You need a universal solution, which when you click on any block displays the text content of all blocks in this row and at the same time hides all the others (if open).
By default, all textual content is hidden.
The problem is that the number of rows is not defined.
HTML code of the series:
<div class="row"> <div class="c3 toogle"> <p class="toogle-text">ΠΠ΅ΠΊΠΈΠΉ ΡΠ΅ΠΊΡΡ</p> </div> <div class="c3 toogle"> <p class="toogle-text">ΠΠ΅ΠΊΠΈΠΉ ΡΠ΅ΠΊΡΡ</p> </div> <div class="c3 toogle"> <p class="toogle-text">ΠΠ΅ΠΊΠΈΠΉ ΡΠ΅ΠΊΡΡ</p> </div> </div>
I was thinking of adding indexes to each row, but this is a Hindu version, but right now I do not know how.
$('.toogle').click(function() { $('.toogle-text').slideToggle(); });