SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Jan 2011
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to keep the Parent and child page highlighted in the menu?

    Can someone to modify the code below to highlight the parent menu item when a child page is selected? Thanks.

    CSS:

    #nv { overflow: hidden; padding-left: 3px; height: 33px; {MENUBGCODE}; }
    #nv li { float: left; padding-right: 1px; height: 33px; line-height: 33px; background: url({IMGDIR}/nv_a.png) no-repeat 100% 0; font-weight: 700; font-size: 14px; }
    .ie_all #nv li { line-height: 36px; }
    .ie6 #nv li { line-height: 33px; }
    #nv li a { float: left; padding: 0 9px; height: 33px; }
    #nv li a { color: {MENUTEXT}; }
    #nv li span { display: none; }
    #nv li.a { margin-left: -1px; {MENUHOVERBGCODE}; }
    #nv li.a a { color: {MENUHOVERTEXT}; }
    #nv li a:hover { background: url({IMGDIR}/nv_a.png) no-repeat 50% -66px; }
    #nv li.hover a:hover, #nv li.hover a { background: url({IMGDIR}/nv_a.png) no-repeat 50% -99px; }
    #mu { position: relative; z-index: 1; }
    .ie6 #mu, .ie7 #mu { line-height: 0; font-size: 0; }
    #mu ul { background: url({IMGDIR}/mu_bg.png) no-repeat 0 100%; line-height: 22px; z-index: 2; font-size: 12px; }
    #mu li { float: left; height: 32px }
    #mu a { float: left; display: inline; margin: 5px 6px; padding: 0 10px; white-space: nowrap; }
    #mu a:hover { margin: 4px 5px; border: 1px solid {SPECIALBORDER}; background: {SPECIALBG}; color: {HIGHLIGHTLINK}; text-decoration: none; }
    .floatmu { position: absolute; left: 0; top: 0; }


    HTML:

    <div id="nv">
    <ul>
    <!--{loop $_G['setting']['navs'] $nav}-->
    <!--{if $nav['available'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1))}--><li {if $mnid == $nav[navid]}class="a" {/if}$nav[nav]></li><!--{/if}-->
    <!--{/loop}-->
    </ul>
    <!--{hook/global_nav_extra}-->
    </div>
    <!--{if !empty($_G['setting']['plugins']['jsmenu'])}-->
    <ul class="p_pop h_pop" id="plugin_menu" style="display: none">
    <!--{loop $_G['setting']['plugins']['jsmenu'] $module}-->
    <!--{if !$module['adminid'] || ($module['adminid'] && $_G['adminid'] > 0 && $module['adminid'] >= $_G['adminid'])}-->
    <li>$module[url]</li>
    <!--{/if}-->
    <!--{/loop}-->
    </ul>
    <!--{/if}-->
    $_G[setting][menunavs]
    <div id="mu" class="cl">
    <!--{if $_G['setting']['subnavs']}-->
    <!--{loop $_G[setting][subnavs] $navid $subnav}-->
    <!--{if $_G['setting']['navsubhover'] || $mnid == $navid}-->
    <ul class="cl {if $mnid == $navid}current{/if}" id="snav_$navid" style="display:{if $mnid != $navid}none{/if}">
    $subnav
    </ul>
    <!--{/if}-->
    <!--{/loop}-->
    <!--{/if}-->
    </div>

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    What kind of html is that? Are you using a template system?

  3. #3
    SitePoint Member
    Join Date
    Jan 2011
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is from a template system but I don't use all of the features.

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,168
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    It would be better to grab the generated HTML (view source in your browser) as that is not HTML that we can work with.

  5. #5
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Upload your page and give us URL, so we can check and find the solutions.

  6. #6
    SitePoint Member
    Join Date
    Jan 2011
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am using part of the system like this Chinese site and try to make it work like their menu. http://www.verycd.com/base/cartoon/theater/

  7. #7
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,168
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by etask View Post
    I am using part of the system like this Chinese site and try to make it work like their menu.
    How about posting a link to your own site? I can't see the point of that link, which tells me nothing about your site. Did you read the posts above?

  8. #8
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If it's all about highlighting the parent and child URLs on website. then I guess using them as secondry menus at any sidebar will be the better option.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •