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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:25:39+00:00 2026-06-18T15:25:39+00:00

am having a problem getting multiple levels working on a responsive css menu, the

  • 0

am having a problem getting multiple levels working on a responsive css menu, the base of the menu i have followed this tutorial on tuts.com

I need more than 2 sub levels on this menu for my site, though when i add the extra ‘s to the html, the extra level is not working as it should, am sure its possible to add an extra level to the original menu, but i cant figure out what extra css i need, i had tried adding extra css code for li li li li but thats not working for me.

the extra level displays wwith the 2nd sublevel, where it should only display for the hover of the 2nd sub-menu.

i have created a jsfiddle (my first one) here: http://jsfiddle.net/DizzyHigh/Bpubu/4/

html:

<div id="left_container"></div>
<div class="container">
<a class="toggleMenu" href="#">Menu</a>

    <ul class="nav">
        <li class="test">   <a href="#">HOME</a>

        </li>
        <li>    <a href="#">LOCATIONS</a>

            <ul class="nav">
                <li>    <a href="#">Boroughs</a>

                    <ul class="nav">
                        <li>    <a href="#">Enfield</a>

                            <ul>
                                <li><a href="#">E-Locations</a>
                                </li>
                                <li><a href="#">E-Unit Bases</a>
                                </li>
                                <li><a href="#">E-Parking</a>
                                </li>
                            </ul>
                        </li>
                        <li> <a href="#">Barnet</a>

                            <ul>
                                <li><a href="#">B-Locations</a>
                                </li>
                                <li><a href="#">B-Unit Bases</a>
                                </li>
                                <li><a href="#">B-Parking</a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>
                <li>    <a href="#">Maps</a>

                    <ul class="nav">
                        <li>    <a href="#">Enfield map</a>

                            <ul>
                                <li><a href="#">ME-Locations</a>
                                </li>
                                <li><a href="#">ME-Unit Bases</a>
                                </li>
                                <li><a href="#">ME-Parking</a>
                                </li>
                            </ul>
                        </li>
                        <li>    <a href="#">Barnet Map</a>

                            <ul>
                                <li><a href="#">MB-Locations</a>
                                </li>
                                <li><a href="#">MB-Unit Bases</a>
                                </li>
                                <li><a href="#">MB-Parking</a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>
            </ul>
        </li>
        <li>    <a href="#">CONTACT</a>

        </li>
        <li>    <a href="#">LINKS</a>

        </li>
    </ul>
</div>
<div id="right_container">&nbsp;</div>

css:

body, nav, ul, li, a  {margin: 0; padding: 0;}
body {font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
a {text-decoration: none;}
.container {
    width: 90%;
    max-width: 900px;
    margin: 10px auto;
}
.toggleMenu {
    display:  none;
    background: #666;
    padding: 10px 15px;
    color: #fff;
}
.nav {
    list-style: none;
     *zoom: 1;
     background:#175e4c;
}
.nav:before,
.nav:after {
    content: " "; 
    display: table; 
}
.nav:after {
    clear: both;
}
.nav ul {
    list-style: none;
    width: 9em;
}
.nav a {
    padding: 10px 15px;
    color:#fff;
}
.nav li {
    position: relative;
}
.nav > li {
    float: left;
    border-top: 1px solid #104336;
}
.nav > li > .parent {
    background-image: url("images/downArrow.png");
    background-repeat: no-repeat;
    background-position: right;
}
.nav > li > a {
    display: block;
}
.nav li  ul {
    position: absolute;
    left: -9999px;
}
.nav > li.hover > ul {
    left: 0;
}
.nav li li.hover ul {
    left: 100%;
    top: 0;
}
.nav li li a {
    display: block;
    background: #1d7a62;
    position: relative;
    z-index:100;
    border-top: 1px solid #175e4c;
}
.nav li li li a {
    background:#249578;
    z-index:200;
    border-top: 1px solid #1d7a62;
}

@media screen and (max-width: 768px) {
    .active {
        display: block;
    }
    .nav > li {
        float: none;
    }
    .nav > li > .parent {
        background-position: 95% 50%;
    }
    .nav li li .parent {
        background-image: url("images/downArrow.png");
        background-repeat: no-repeat;
        background-position: 95% 50%;
    }
    .nav ul {
        display: block;
        width: 100%;
    }
   .nav > li.hover > ul , .nav li li.hover ul {
        position: static;
    }

}

JS:

 $(document).ready(function() {
    var ww = document.body.clientWidth;


        $(".nav li a").each(function() {
            if ($(this).next().length > 0) {
                $(this).addClass("parent");
            };
        })

        $(".toggleMenu").click(function(e) {
            e.preventDefault();
            $(this).toggleClass("active");
            $(".nav").toggle();
        });




    adjustMenu();
    var adjustMenu = function() {
        if (ww < 768) {
            $(".toggleMenu").css("display", "inline-block");
            if (!$(".toggleMenu").hasClass("active")) {
                $(".nav").hide();
            } else {
                $(".nav").show();
            }
            $(".nav li").unbind('mouseenter mouseleave');
            $(".nav li a.parent").unbind('click').bind('click', function(e) {
                // must be attached to anchor element to prevent bubbling
                e.preventDefault();
                $(this).parent("li").toggleClass("hover");
            });
        } 
        else if (ww >= 768) {
            $(".toggleMenu").css("display", "none");
            $(".nav").show();
            $(".nav li").removeClass("hover");
            $(".nav li a").unbind('click');
            $(".nav li").unbind('mouseenter mouseleave').bind('mouseenter mouseleave', function() {
                // must be attached to li so that mouseleave is not triggered when hover over submenu
                $(this).toggleClass('hover');
            });
        }
    }
$(window).bind('resize orientationchange', function() {
        ww = document.body.clientWidth;
        adjustMenu();
    });
})

can any css gurus point me in the right direction?

  • 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-18T15:25:41+00:00Added an answer on June 18, 2026 at 3:25 pm

    Bryn try the follwing code:

    I use ‘NormalMenu’ class for css hover event on normal menu

    Java Script

    var adjustMenu = function() {
     if (ww < 768) {                
        $(".toggleMenu").css("display", "inline-block");
        if (!$(".toggleMenu").hasClass("active")) {
            $(".nav").hide();
        } else {
            $(".nav").show();
        }
        $('.nav').removeClass('NormalMenu').find('ul').hide();              
        $(".nav li a").unbind('click').bind('click', function(e) {
                // must be attached to anchor element to prevent bubbling
            e.preventDefault();
            var _sub = $(this).siblings('ul')
            if($(_sub).is(':visible')){
                $(_sub).hide(); 
                $(_sub).find('ul').hide();
            }else{
                $(_sub).show(); 
            }
        });
     } 
     else if (ww >= 768) {        
        $(".toggleMenu").css("display", "none");        
        $(".nav li a").unbind('click');
                $(".nav").show().addClass('NormalMenu').find('ul').removeAttr('style');     
     }
    }
    

    CSS

    body, nav, ul, li, a  {margin: 0; padding: 0;}
    body {font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
    a {text-decoration: none;}
        .container {
        width: 90%;
        max-width: 900px;
        margin: 10px auto;
    }
    .toggleMenu {
        display:  none;
        background: #666;
        padding: 10px 15px;
        color: #fff;
    }
    .nav {
        list-style: none;
         *zoom: 1;
         background:#175e4c;
    }
    .nav:before,
    .nav:after {
        content: " "; 
        display: table; 
    }
    .nav:after {
        clear: both;
    }
    .nav ul {
        list-style: none;
        width: 9em;
    }
    .nav a {
        padding: 10px 15px;
        color:#fff;
    }
    .nav li {
        position: relative;
    }
    .nav > li {
        float: left;
        border-top: 1px solid #104336;
    }
    .nav > li > .parent {
       /* background-image: url("images/downArrow.png");*/
        background-repeat: no-repeat;
        background-position: right;
    }
     ul.NormalMenu ul{       
        width: 100%;
        display:none;
        position: absolute;
     }
    ul.NormalMenu li{        
        line-height:40px;
    }
    
    
    ul.NormalMenu  li:hover > ul{       
        width: 100%;
        display:block;
        left:0; 
    }
    ul.nav ul li{
        background: #1d7a62;        
     }
    ul.NormalMenu  li li:hover> ul{       
        width: 100%;
        display:block;
        top:0;
        left:100%;        
        }
    ul.nav ul li li{
        background: #1d7a00;
     }
    
    @media screen and (max-width: 768px) {
    .active {
        display: block;
    }
    .nav > li {
        float: none;
    }
    .nav > li > .parent {
        background-position: 95% 50%;
    }
    .nav li li .parent {
        /*background-image: url("images/downArrow.png");*/
        background-repeat: no-repeat;
        background-position: 95% 50%;
    }
    
     ul.nav ul{
        margin-left:5%;   
         width: 95%;
       } 
    ul.nav li{
        line-height:30px;
    
    }
    

    }

    See Demo: http://jsfiddle.net/ducwidget/Bpubu/21/

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

Sidebar

Related Questions

I am having problem getting this piece of code to run. The class is
I'm having a problem getting this test case to work. Can anyone point me
I am having a problem getting multiple attributes for one item. Below is my
I'm having a problem getting a bitmap to rotate properly. I have a SurfaceView
I'm having a major problem getting a parent/child relationship working for a hierarchy of
Hi im having an interesting problem. Update: From the comments im getting below this
I am having an issue with getting a Multiple search working with a IQueryable.Where
I'm having this weird problem where other instances of my jQuery plugin are getting
I am having problem getting my tooltip to work when using the jQuery load()
I am having a problem getting Twitter Bootstrap Carousel to begin looping automatically at

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.