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 9080057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:59:09+00:00 2026-06-16T19:59:09+00:00

Hi I have a accordion menu in a wordpress site. The standard menu that

  • 0

Hi I have a accordion menu in a wordpress site. The standard menu that came with the theme didn’t do quite what I wanted so I’ve tried to customise it.

the javascript code is..

//DROPDOWN SCRIPT
$("#navbar > li").click(function(){
if(false == $(this).next().is(':visible')) {
    $('#navbar > ul').slideUp(300);
}
$(this).next().slideToggle(300);
});
$('#navbar > ul:eq(0)').show();

the css is…

#navbar {
list-style: none;
padding: 0 0 0 0;
width: 233px;
}

#navbar li{
text-align:center;
display: block;
font-weight: bold;
margin-bottom: 2px;
cursor: pointer;
list-style: circle;
height:29px;
line-height:normal;
}

#navbar ul {

list-style: none;
padding: 0 0 0 0;
display: none;

}

#navbar ul li{

font-weight: normal;
cursor: auto;
background-color: #fff;
padding: 0 0 0 7px;
line-height:normal;

}

#navbar a {
padding-top:5px;
text-decoration: none;
font-size: 19px;


}

#navbar a:hover {


}
#navbar li:first-child
{margin:2px 0 2px 0;
background:url(images/menuBG.png) 0px -90px;}

#menu-item-12{
background:url(images/menuBG.png) 0px -126px;}
#menu-item-13{
background:url(images/menuBG.png) 0px -163px;}
#menu-item-14{
background:url(images/menuBG.png) 0px -200px;}
#menu-item-15{
background:url(images/menuBG.png) 0px -236px;}
#menu-item-16{
background:url(images/menuBG.png) 0px -272px;}
#menu-item-17{
background:url(images/menuBG.png) 0px -344px;}
#menu-item-18{
background:url(images/menuBG.png) 0px -380px;}
#menu-item-30{
background:url(images/menuBG.png) 0px -416px;}
#menu-item-19{
background:url(images/menuBG.png) 0px -452px;}

#navbar li#menu-item-12 a, #navbar li#menu-item-13 a,#navbar li#menu-item-14 a, 
#navbar li#menu-item-29 a {
color:#76a443   }

the HTML is…

<ul id="navbar" class="menu">
<li id="menu-item-29" class="menu-item menu-item-type-custom
 menu-item-object-custom firstmenuitem"><a href="http://#" class="item"> Pests </a></li>
<li id="menu-item-51" class="menu-item menu-item-type-custom menu-item-object-custom">
<a> Products </a>
<ul class="sub-menu">
<li id="menu-item-22" class="menu-item menu-item-type-custom menu-item-object-custom">
<a href="#" class="item">Nemaslug</a></li>
<li id="menu-item-23" class="menu-item menu-item-type-custom menu-item-object-custom">
<a href="#" class="item">Vine Weevile Killer</a></li>
<li id="menu-item-24" class="menu-item menu-item-type-custom menu-item-object-custom">
<a href="#" class="item">NO ANTS!</a></li>
<li id="menu-item-25" class="menu-item menu-item-type-custom menu-item-object-custom">
<a href="#" class="item">Grow Your Own</a></li>
<li id="menu-item-52" class="menu-item menu-item-type-custom menu-item-object-custom">
<a href="http://LeatherJacketKiller" class="item">LeatherJacket Killer</a></li>
</ul>
</li>
<li id="menu-item-13" class="menu-item menu-item-type-custom menu-item-object-custom">
<a href="#" class="item"> Damage Identifier </a></li>
<li id="menu-item-14" class="menu-item menu-item-type-custom menu-item-object-custom">
<a href="#" class="item"> Pest Identifier </a></li>
<li id="menu-item-15" class="menu-item menu-item-type-custom menu-item-object-custom">
<a href="#" class="item"> About Nematodes </a></li>
<li id="menu-item-16" class="menu-item menu-item-type-custom menu-item-object-custom">
<a href="#" class="item"> Where to Buy </a></li>
<li id="menu-item-17" class="menu-item menu-item-type-custom menu-item-object-custom">
<a href="#" class="item"> Gardeners Forum </a></li>
<li id="menu-item-18" class="menu-item menu-item-type-custom menu-item-object-custom">
<a href="#" class="item"> Downloads </a></li>
<li id="menu-item-30" class="menu-item menu-item-type-custom menu-item-object-custom">
<a href="http://#" class="item"> News </a></li>
<li id="menu-item-19" class="menu-item menu-item-type-custom menu-item-object-custom
lastmenuitem"><a href="#" class="item"> Links </a></li>
</ul>               
<!-- Navbar ends here -->   
</div>
<!-- Menu ends here -->

It’s not functioning properly, it’s hiding the link below instead of displaying its sub links, if you click on “products” link you will see what I mean, there are 5 sub categories in products. but instead it hides the top level category below it.

The site is also up on a test url. http://test5.cr8tivejuice.co.uk

  • 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-06-16T19:59:11+00:00Added an answer on June 16, 2026 at 7:59 pm

    Try this

    Css code

    #navbar li{
        text-align:center;
        font-weight: bold;
        margin-bottom: 2px;
        cursor: pointer;
        list-style: circle;
        height:29px;
        line-height:normal;
        display: table;
        width: 100%;
    }
    

    Js code:

    $("#navbar > li").click(function(){
      var child = '#' + $(this).attr('id') + ' > ul';
        $(child).slideToggle();
    });
    $('#navbar > ul:eq(0)').show();
    

    And see this Example

    Greetings.

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

Sidebar

Related Questions

I have this JavaScript code that enables a accordion menu to function, it works,
I have a jquery accordion style menu that I'd like to add some shortcut
I have a custom accordion script that I'm trying to adapt for another site.
I have a vertical accordion menu that opens on hover, stays open and closes
I'm new to jQuery. I have an accordion menu that I am trying to
I really cannot find the solution on other questions! I have that accordion menu
I have an accordion menu that is working excellent in chrome, IE8, firefox, however,
I have created a jquery accordion menu inside a user control and used that
So I have an accordion menu that I created with Jquery: <script> $(document).ready(function() {
so I have a jQuery accordion menu that I want to implement to my

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.