dimanche 18 octobre 2020

How can i change the Drop Down Menu button for mobile?

Hey Developers and Coding Masters! I hope you all are doing good!

As I am not good at all in Coding, You guys helped me alot and Solved my So manyyy problems. Just because of you guys, I have managed to make my website better and made my visitors happy and satisfied.

This time again My website have some issue, due to that my visitors struggles.

  • The issue is with the Drop Down Menu when website loads in mobile.
  • The Drop-down-list appears (expand) when user click on >. Means when user click on class "Submenu-toggle", Drop Down Menu Expands. Whereas I want to expand Submenus when user click on class "has-sub"

HTML

<li class="has-sub"><a href="#" role="menuitem">Main Menu</a></li>

<div class="submenu-toggle"></div>

Script that website is using

$('#main-menu-nav')['clone']()['appendTo']('.mobile-menu');
    $('.mobile-menu .has-sub')['append']('<div class="submenu-toggle"/>');
    $('.mobile-menu ul > li a')['each'](function () {
        var _0x951axf = $(this),
            _0x951ax11 = _0x951axf['attr']('href')['trim'](),
            _0x951ax12 = _0x951ax11['toLowerCase'](),
            _0x951ax13 = _0x951ax11['split']('/'),
            _0x951ax14 = _0x951ax13[0];
        if (_0x951ax12['match']('mega-menu')) {
            _0x951axf['attr']('href', '/search/label/' + _0x951ax14 + '?&max-results=' + postPerPage)
        }
    });
    $('.slide-menu-toggle')['on']('click', function () {
        $('body')['toggleClass']('nav-active');
        $('.overlay')['fadeToggle'](170)
    });
    $('.mobile-menu ul li .submenu-toggle')['on']('click', function (_0x951axf) {
        if ($(this)['parent']()['hasClass']('has-sub')) {
            _0x951axf['preventDefault']();
            if (!$(this)['parent']()['hasClass']('show')) {
                $(this)['parent']()['addClass']('show')['children']('.m-sub')['slideToggle'](170)
            } else {
                $(this)['parent']()['removeClass']('show')['find']('> .m-sub')['slideToggle'](170)
            }
        }
    });

Aucun commentaire:

Enregistrer un commentaire