How to make the click open and redirect to the page?
-
Hello, how to make it so that in the mobile version, when you click in the menu, it opens immediately, and then, when you repeat it, follows the link
$('body').on('click', 'header ul.navigation li a', function (e) { if ($(this).children('.arrow-icon').length > 0) { e.preventDefault(); e.stopPropagation(); $(this).toggleClass("mobile-active"); $(this).siblings('.navigation-dropdown').slideToggle(); $(this).siblings('.navigation-dropdown-wide-inner').slideToggle(); $(this).siblings('.navigation-dropdown-wide').slideToggle(); } })
<ul class="navigation"> <li class=" navigation-wide"> <a href="/catalog/" class="">Каталог <span class="arrow-icon icon-down"></span></a> <ul class="navigation-dropdown-wide" style="display: block;"> <li class="level0"> <a href="/catalog/reduktory-xoda/" class="">Редукторы хода<span class="arrow-icon icon-right"></span></a> <ul class="navigation-dropdown-wide-inner" style="display: none;"> <li class="level1"> <a href="/catalog/reduktory-xoda/hitachi/">Hitachi<span class="arrow-icon icon-right"></span></a>
Here is the codeJavaScript Anonymous, Feb 6, 2019 -
Like this:
if (
$(this).children('.arrow-icon').length > 0
&& !$(this).hasClass("mobile-active");
) {Sean Li
1 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!