I'm a beginner front-end development. I'm from Ukraine and my English is so so... but I learning English again and again.
So I'll go on...
How can I make that when I click on a new block, the previous one is closed? enter image description here
I have this code
<pre>
<div class="gallery__column">
<div class="gallery__item">
<div class="overlay gallery__overlay"></div>
<div class="gallery__image">
<a class="content-open" href="##">
<img class="gallery__img" src="img/example/01.jpg" alt="">
<span data-tab="tab-4" class="gallery__arrow arrow"></span>
</a>
</div>
<div class="gallery__content" id="tab-4">
<h4 class="gallery__title">Электрические шторы</h4>
<div class="gallery__brand">SOMFY 1</div>
<div class="gallery__text"></div>
</div>
</div>
</div>
</pre>
<div class="gallery__item">
<div class="overlay gallery__overlay"></div>
<div class="gallery__image">
<img class="gallery__img" src="img/example/02.jpg" alt="">
<a class="content-link" href="##"></a>
<span data-tab="tab-1" class="gallery__arrow arrow"></span>
</div>
<div class="gallery__content" id="tab-1">
<h4 class="gallery__title">Электрические шторы</h4>
<div class="gallery__brand">SOMFY 1</div>
<div class="gallery__text">
</div>
</div>
$('.arrow').on('click', function(){
$('.arrow').removeClass('active');
$('.arrow').parents().siblings('.gallery__content');
$(this).addClass('active');
$(this).parents().siblings('.gallery__content').slideToggle();
});