Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2013
    Posts
    19
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Hide Nav Menu Links...

    I have a nav menu that has a category on the right side called Utilities (www.mixnob.com). I am wanting to make this not visible on my nav bar. I would just delete the category in the shopping cart admin software but then all the items in that category aren't visible in the store. I still want the items and the category in my store, I just don't want the word, Utilities, on my nav menu. So I figured I would just hide it.

    I came up with this code below to find the word, but how do I hide it? Also, the space that it takes up needs to collapse and disappear as well.

    Code:
    <script type="text/javascript">
    
    document.getElementById( "HeaderLower" ).getElementsByTagName( 'A' )[ 9 ];
    
    </script>
    Any help would be appreciated.

    Thanks,
    Brook Floyd

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    Since you are already including jQuery in your site it make it very easy
    Code:
    $('#SideCategoryList li:contains("Utilities")').hide()
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

  • #3
    New Coder
    Join Date
    Jan 2013
    Posts
    19
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Ah, thank you so much for that. It works perfectly. If for some reason I want to hide another category (let's say 'Products') in the future would I just add another line and do something like this...

    Code:
    $('#SideCategoryList li:contains("Utilities,Products")').hide()
    or something more like this...

    Code:
    $('#SideCategoryList li:contains("Utilities")').hide()
    $('#SideCategoryList li:contains("Products")').hide()
    Thanks,
    Brook Floyd


  •  

    Posting Permissions

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