Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter eska66

    (@eska66)

    @ibby I’m a complete rookie regarding website designing, I wish I could help. I just checked my website, because I haven’t visited it for a while, but the side menu still works good, no base code changed or anything.

    The problem might be with the amount of sub-menus you got in your menu, I guess. If I had just one sub-menu less than I needed, that code would not even be neccessary to be attached to scripts. Or on the other hand, if you have one sub-menu more than I did, then the code I’ve given would have to be expanded somehow analogically to how mine cod has been.

    Thread Starter eska66

    (@eska66)

    @apequeno I downloaded ‘Scripts n Styles’ plug-in and pasted this code in ‘Scripts
    (for the head element)’ section. Should work.

    @ibby I personally prefer to stick to script tags, honestly speaking. It’s easier to change them later, if you know how to operate on them.

    I believe the scripts are easier way for small additions, if you know how to operate on them.

    Regards

    • This reply was modified 7 years, 3 months ago by eska66.
    Thread Starter eska66

    (@eska66)

    Sure thing, I haven’t posted it because I doubted anyone had the same problem since there were no topics that matched my question. 😉

    (function($) {
    $( document ).ready(function() {
    $( “li.current_page_item” ).each(function( index ) {
    $(this).parent(‘.sub-menu’).slideToggle(‘fast’);
    $(this).parent().parent(‘.sub-menu’).slideToggle(‘fast’);
    });
    
    $( “li.current-menu-ancestor” ).each(function( index ) {
    $(this).parent(‘.sub-menu’).slideToggle(‘fast’);
    });
    });
    })(jQuery);

    Simply, just replace ‘parent’ with ‘ancestor’ so it stays like “li.current-menu-ancestor”. That worked for my menu.

    Regards

    • This reply was modified 7 years, 11 months ago by eska66.
    • This reply was modified 7 years, 11 months ago by eska66.
    Thread Starter eska66

    (@eska66)

    problem solved

Viewing 4 replies - 1 through 4 (of 4 total)