Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4012698
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:16:47+00:00 2026-05-20T09:16:47+00:00

I have a simple menu that slides down more UL when the parent LI

  • 0

I have a simple menu that slides down more UL when the parent LI is clicked, if there is a child UL to follow…

I am trying to make it so when the menu is in a certain directory it will have that menu expanded by default rather than closed. I have tried a few things, but am just not getting it to work. Currently I have a IF statement comparing the PATHNAME with the Varibles and just telling that ID to keep the UL open… That has been as close as I can get.

Any suggestions on how to make the UL stay open if the page url is the same as the parent UL HREF?

You can see the code here: http://jsfiddle.net/RvGMQ/

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:16:48+00:00Added an answer on May 20, 2026 at 9:16 am

    Ok, so I got something to work here. Let me know if there is a better way if you come across this post…

    I ended up creating a Meta Tag called MyTitle and gave it content to compare an ID to then display UL based on that Meta Tag.

        $(document).ready(function() {
        $("#menu ul ul").hide();
        $("#menu ul li").click(function()
        {
            $(this).next("ul").slideToggle(300).siblings("ul").slideUp("slow");
        });
    
    //created a meta tag called MyTitle to use as a way to open menu when needed. This function checks for the value of MyTitle. Got this from (http://forums.macrumors.com/showthread.php?t=569947)
    var mytitle;
    var metas = document.getElementsByTagName('meta');
    for (var x=0,y=metas.length; x<y; x++) {
      if (metas[x].name.toLowerCase() == "mytitle") {
        mytitle = metas[x];
      }
    }
    
    //Find the page currently on and display menu if need be.
    var title = "" + mytitle.content;
    if(title == "Resources")
        $("ul #resources").show();
    if(title == "Conferences")
        $("ul #conferences").show();
    

    etc……….

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I trying to make a simple animated menu that slides in and out but
I have a simple dropdown menu that works nicely but is there a way
I have a simple horizontal menu that uses JQuery to vertically slide down a
I have a simple drop-down menu that is controlled using the following script: $(document).ready(function
I have a really simple menu that I'd like to add a drop-down. What
I am trying to make a simple menu with a nice transition effect using
I have a simple menu that looks like this: <ul class=menu> <li class=active><a href=<%=
I'm trying to create a quick and dirty simple menu that is generated by
I'm trying to make a simple jQuery panel slider and have it basically where
Do I have any simple way to have context menu items, that aren't highlighted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.