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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:46:52+00:00 2026-05-27T09:46:52+00:00

I’d like to use the vertical sliding/toggle menu, please see my code below, at

  • 0

I’d like to use the vertical sliding/toggle menu, please see my code below, at the moment the menu toggles only when you click on the + sign, please see the code below.

I’m trying to work out a way when you click on the category name eg Posts and the sub menu would open (same functionality with the +) and the page would go to Posts page. And when you click on the + sign, the function and the page stay the same.

How can I target this task? Your help / suggestion is appreciated.

Thank you!

<html>
<head>
<style type="text/css">
body{background:#CCC;}
#container{margin:0 auto; background:white; border:1px solid #999; width:400px;       padding:20px; -moz-border-radius:10px;-webkit-border-radius:10px;  overflow:hidden;}
#menu {text-align:left;}
/*Toggle Area*/
#menu .toggle {float:right;width:9px; padding:5px; cursor:pointer; border-top:1px     solid white; border-left:1px solid #E0E0E0; color:#999;}
#menu ul.navmenu li:first-child .toggle{border-width:0 0 0 1px;}
/*Menu Setup*/
#menu ul{padding:0; margin:0; width:150px;}
#menu ul ul{border:1px solid #CCC;overflow:hidden;}
#menu ul.navmenu li {margin:0; list-style:none;float:left;}
#menu ul.navmenu li li {float:none;}
/*Links*/
#menu ul.navmenu a, #menu ul.navmenu a:visited {text-decoration:none; padding:5px; display:block; color:#008FDD;}
#menu ul.navmenu ul.submenu a:hover{background:#FFF4D2; color:#333;}
/*Heading Outer div*/
#menu ul.navmenu .menutop{border:1px solid #CCC; border-width:0 1px; overflow:hidden; width:150px; background:#F9F9F9; }
/*Header Links*/
#menu ul.navmenu .menutop a{width:120px;float:left;margin:0 0 1px 0; border-top:1px solid white;}
/*Header Link Hover*/
 #menu ul.navmenu .menutop a:hover{color:#333;}
/*Removes white border for the first header*/
 #menu ul.navmenu li:first-child .menutop a {border-width:0px;}
/*Single Menu Width Fix*/
#menu ul.navmenu .menusingle a{width:140px;}
/*Border Radius and Special Border Width*/
#menu ul.navmenu li:first-child .menutop{border-width:1px 1px 0 1px; -moz-border-radius:5px 5px 0 0;-webkit-border-top-left-radius:5px;-webkit-border-top-right-radius:5px;}
#menu ul.navmenu li:last-child .menutop{border-width:0px 1px 1px 1px; -moz-border-radius:0 0 5px 5px; -webkit-border-bottom-left-radius:5px;-webkit-border-bottom-right-radius:5px;}
 #menu ul.navmenu li:last-child ul.submenu{-moz-border-radius:0 0 5px 5px;-webkit-border-bottom-left-radius:5px;-webkit-border-bottom-right-radius:5px;}
#menu ul.navmenu li:last-child .menutop-open{-moz-border-radius:0;-webkit-border-radius:0px; border-width:0 1px;} 
</style>
<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"   type="text/javascript">

</script>



<script type="text/javascript">
$(document).ready(function(){
hideMenus();

$('.toggle').click(function(){
    var menu = $(this);
    hideMenus();

    if (menu.hasClass('toggle-open')) {     
        menuHide(menu);
    }else{
        menuShow(menu);
    }
});
});
 function hideMenus(){
$('.toggle').each(function(){
    menuHide($(this));
});
}

function menuHide(menu){ 
menu.removeClass('toggle-open').addClass('toggle-closed').empty('').append('+').parents('li').children('ul').slideUp(250); 
menu.parent('.menutop').removeClass('menutop-open').addClass('menutop-closed'); 
} 
function menuShow(menu){ 
menu.parent('.menutop').removeClass('menutop-closed').addClass('menutop-open'); 
menu.removeClass('toggle-closed').addClass('toggle-open').empty('').append('–').parents('li').children('ul').slideDown(250); 
}



</script>
</head>

<body>
<div id="container">
<div id="menu">
<ul class="navmenu">
<li><div class="menutop"><a href="#">Posts</a><div class="toggle">+</div></div>
 <ul class="submenu">
   <li><a href="#">Add New</a></li>
   <li><a href="#">Tags</a></li>
 </ul>
</li>
<li><div class="menutop"><a href="#">Pages</a><div class="toggle">+</div></div>
 <ul class="submenu">
   <li><a href="#">Add New</a></li>
   <li><a href="#">Edit</a></li>
 </ul>
</li>
<li><div class="menutop menusingle"><a href="#">Comments</a></div></li>
<li><div class="menutop"><a href="#">Users</a><div class="toggle">+</div></div>
 <ul class="submenu">
   <li><a href="#">Manage</a></li>
   <li><a href="#">Add New</a></li>
   <li><a href="#">Profile</a></li>
 </ul>
</li>
</ul>
</div></div>
</body>
</html>
  • 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-27T09:46:53+00:00Added an answer on May 27, 2026 at 9:46 am

    This is code I have used to do exactly that, except I used arrow images instead of + and – but you should be able to modify it. Hope it helps!

    Edit:
    I’ve put the code below onto JSFiddle so you can try it out: http://jsfiddle.net/CrxAg/3/

    HTML:

    <div id="menu">
        <div class="submenublock" id="submenu1"><h3>Category1</h3>
            <ul>
                <li><a href="page.html">option1</a></li>
                <li><a href="page.html">option2</a></li>
            </ul>
         </div>
        <div class="submenublock" id="submenu2"><h3>Category2</h3>
            <ul>
                <li><a href="page.html">option1</a></li>
                <li><a href="page.html">option2</a></li>
            </ul>
         </div>
    </div>
    

    JS:

    $(document).ready(function(){
        $('div.submenublock > ul').hide();  
        $("div.submenublock > h3").css("background", "url(images/menuarrowdown.gif) no-repeat right bottom");
    
        $('div.submenublock > h3').click(function() {
            $(this).next().slideToggle('fast',function(){
                //set arrow depending on whether menu is shown or hidden
                if ($(this).is(':hidden')) {
                    $(this).prev().css("background", "url(images/menuarrowdown.gif) no-repeat right bottom"); 
                } else {
                    $(this).prev().css("background", "url(images/menuarrowup.gif) no-repeat right bottom"); 
                }
                return false;
            }); 
       });
    
        /* change appearance of h3 element on hover to make it look like a link */
        $('div.submenublock > h3').hover(over, out);
        function over(event) {
            $(this).find("a").css("color", "#663");
            $(this).css("cursor", "pointer");
        }
        function out(event) {
            $(this).find("a").css("color", "");
            $(this).css("cursor", "default");
        } 
        /*end hover code*/
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I would like to count the length of a string with PHP. The string
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string

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.