How to make the click open and redirect to the page?

  • 0
    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 code
    JavaScript Anonymous, Feb 6, 2019

  • 1 Answers
  • 0
    Like this:

    if (
    $(this).children('.arrow-icon').length > 0
    && !$(this).hasClass("mobile-active");
    ) {
    Sean Li

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!