Answer the question
In order to leave comments, you need to log in
Why doesn't a simple accordion work on iOS?
Hello everyone, the essence of the problem: the simplest accordion works on chrome and in Googlephones, but does not work (it works every other time - by poking the "button" several times) on iPhones and safari, respectively, what is the problem and how best to solve it? Thanks in advance.
js code:
$('.accordeon-menu__item-link').click(function (e) {
e.preventDefault();
$('.accordeon-menu__item').removeClass('accordeon-menu__item--active');
$(this).parent(".accordeon-menu__item").addClass('accordeon-menu__item--active');
});
<div class="mobile-nav">
<ul class="accordeon-menu">
<li class="accordeon-menu__item">
<div class="accordeon-menu__item-content">
Контент
</div>
<div class="accordeon-menu__item-link">Подробнее</div>
</li>
<li class="accordeon-menu__item">
<div class="accordeon-menu__item-content">
Контент
</div>
<div class="accordeon-menu__item-link">Подробнее</div>
</li>
<li class="accordeon-menu__item">
<div class="accordeon-menu__item-content">
Контент
</div>
<div class="accordeon-menu__item-link">Подробнее</div>
</li>
<li class="accordeon-menu__item">
<div class="accordeon-menu__item-content">
Контент
</div>
<div class="accordeon-menu__item-link">Подробнее</div>
</li>
</ul>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question