1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2009
    Rep Power

    Exclamation Help with applying style to menu levels when activated

    hello, I have a pre-written function provided for use to apply styling to a multi-level menu, which is something like ParentMenu->ChildMenu1->ChildMenu1.1, where the ChildMenu1.1 is level 2 (since I started with level 0 for ParentMenu onwards), and here it is linked to a page.

    The function attached in the txt file is the one which am concerned with, more specifically with the part below:

    else { $('#menu-level-' + (menuLevel + 1)).html(html); $('#menu-level-' + (menuLevel + 1)).css('display', 'block'); if (menuLevel == 1) { $('#menu-' + menuId).parent().addClass("parent-active"); $('#menu-level-2').css('visibility', 'hidden'); $('#menu-level-2').html(html); if (html != ''){ $('#menu-level-2').css('visibility','visible'); } } }
    This part is working well if we follow the schema of the menu mentioned above, however, if I have something like ParentMenu->ChildMenu1 only, where the child menu is linked to a page, it is not applying the style to add the "parent-active" class to this child menu.
    Anyone can help me troubleshoot this code pls so that I can add this styling in such cases?
    May be the answer is right infront of the eyes but am failing to see it so far
    Attached Files
    Last edited by lordrt21; June 4th, 2013 at 07:11 AM.

IMN logo majestic logo threadwatch logo seochat tools logo