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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:06:39+00:00 2026-05-28T07:06:39+00:00

I’ve been using the following CSS dropdown box on my website, and I’ve noticed

  • 0

I’ve been using the following CSS dropdown box on my website, and I’ve noticed that when you click to activate the dropdown on an ipad/iphone, there is no way to close the dropdown menu other than refreshing the page.

Is there a JS code that I can add to the bottom of the dropdown box for tablet/phone users so they can close the box if they don’t make a selection?

    /* css */

    #dropdown {

    }
    #dropdown ul {


    }
    #dropdown li {

    }
    .dropmain1 {
        background: #f2f2f2 url(images/gradients/drop1bg.jpg) repeat-x;
        width: 98px;
        border-left: 1px solid #e9e9e9;
        border-right: 1px solid #e9e9e9;
                margin-top: 10px;   

        -moz-box-shadow: 3px 9px 8px #888;

    -webkit-box-shadow: 3px 9px 8px #888;

    box-shadow: 3px 9px 8px #888;

        }

    .dropmain2 {
        background: #f2f2f2 url(images/gradients/drop1bg.jpg) repeat-x;
        border-left: 1px solid #e9e9e9;
        border-right: 1px solid #e9e9e9;
        -moz-border-radius-bottomleft: 7px;
        -moz-border-radius-bottomright: 7px;
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
        padding: 5px;
        -moz-box-shadow: 3px 5px 8px #888;
        -webkit-box-shadow: 3px 5px 8px #888;
        box-shadow: 3px 5px 8px #888;
    }

    #drop2 {  width: 633px;     margin-top: 10px;       padding: 9px; }
    #drop3 {  width: 200px;     margin-top: 10px;       padding: 9px;  }
    #drop4 {  width: 200px;     margin-top: 10px;       padding: 9px; }
    #drop5 {  width: 200px;     margin-top: 10px;       padding: 9px; }


        /*this is the css for the horizontal version*/
        .horizontal ul{
            border: none;
            list-style-type: none;
            padding:0;margin:0;
        }
        .horizontal ul li{
            float: left;
            position: relative;
            margin:0;padding:0;
        }
        a.toplevel {
            display: block;
            color: #525252;
            text-decoration: none;
            overflow: hidden;
            display:inline-block;
            padding-left:15px;
            padding-right: 15px;
            line-height:18px;
            background:transparent url(images/misc/menu_open.gif) center left no-repeat;

        }
        .horizontal li li{
            float: none;
            margin-bottom: -1px;
        }
        .horizontal li li.last{
            border-bottom: none;
        }
        .horizontal ul li ul{
            position: absolute;
            top: 1.3em;
            left: -1px;
        }
        .horizontal ul ul ul{
            width: 130px;
            top: -1px;
            left: 128px;
            margin-top: 0;
        }
        .horizontal.left ul ul ul,.horizontal .left ul ul{
            top: -1px;
            left: -128px;
        }
        .horizontal ul li li a{
            padding: 12px;

        }
        .horizontal ul li:first-child>a{ 
        }
        .horizontal ul li a.first{  
        }
        .horizontal ul li li a.first{
        }
        .horizontal ul li li:first-child>a{  
        }
        div.horizontal ul li.pixelfix ul{
            left: 0;
        }
        div.horizontal ul li.pixelfix ul ul{
            left: 128px;
        }
        /*here we use a little CSS to make a basic/backup dropdown menu in modern browsers *cough* not IE6 or less *cough* if javascript is disabled.Flickering never happens in these browsers*/
        .mlmenu li ul{
            display: none;
        }
        .mlmenu li:hover>ul{
            display: block;
        }
        /*This section makes the menu not work in non-javascript enabled browsers by not showing the menu by default-This can be worked around by making top level links point to a sitemap*/
        .accessible li ul{
            display: block;
        }
        /*Code to show an element has a child*/
        .mlmenu.plus li a:first-child:not(:last-child):after{
            content: ' ';
        }
        .plus a span{
            padding-left: .5em;
        }
        .noshow{
            visibility: hidden;
        }
        /*colors for menu*/

        }
        .bluewhite li a{
            background-color: ;
            color: #ffffff;
        }
        .bluewhite li a:hover,.bluewhite li a.first:hover,.bluewhite .trail a.hover{

            /* HOVER */
        }
        .bluewhite li:first-child>a:hover{

        }
        .bluewhite ul{
            border-color: #000033;
        }






        #ldrop a:link, #ldrop a:visited {


        }
        #ldrop a:hover, #ldrop a:active {


        }


        #holdjump1 {
            padding-left: 8px;  padding-bottom: 6px;
        }
        #holdjump1 div {
        }
        #holdjump1 a:link, #holdjump1 a:visited {
            padding: 2px 0 2px 3px; margin:0;
        }
        #holdjump1 li {
            padding:0; margin:0;
        }



        .fjl {
            display: inline-block; 
            border-bottom: 1px dotted #c1c1c1; 
            width:30%; 
            margin: 0 5px 0 5px; 
            padding: 2px;
            font-size: 12px; 
            font-weight: normal;
        }
        .fjl a:link, .fjl a:visited {
        display: block;
        }
        .fjl a:active, .fjl a:hover {
        background: #a1a1a1;
        text-decoration: none;
        color: #ffffff;
        }







<div id="dropdown" class="mlmenu horizontal bluewhite blindv plus inaccessible delay">

    <ul>
                <li>Menu Link</li>

                      <ul> <li>test</li>  </ul>

        </ul>

</div>
  • 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-28T07:06:39+00:00Added an answer on May 28, 2026 at 7:06 am

    oops!, I just noticed I had posted the wrong “order” of the ul list.

    I posted
    $(‘div#dropdown ul li’).click

    when it actually should be

    $(‘div#dropdown li ul’).click or
    $(‘div#dropdown li ul li’).click

    What I previously posted was for the main links to be opened and closed. The new method I am posting will open close the sub menu. UL inside of the LI. To add more submenu functioning, just keep adding on to the element.

    $('div#dropdown li ul // 1-level drop down
    $('div#dropdown li ul li ul // 2-level drop down
    $('div#dropdown li ul li ul li ul // 3 level drop down.
    

    Or you could just create classes for each level. Example

    instead of a 2-level drop being
    $(‘div#dropdown li ul li ul

    you could just do something like this >>

    Example menu with a 2-level sub menu

    <ul>
       <li>link1<ul class="sub1">
       <li>sublink1-1<ul>
       <li>sub-sublink1-1</li>
       <li>sub-sublink1-2</li></ul></li></ul></li>
    </ul>
    

    Jquery

    <script>
    $(document).ready(function() {
        $('ul.sub1').click(function() {
        $(this).slideToggle();
    
      });
    });
    </script>
    

    That would cause the 2nd level sub menus to slide up or slide down on click, thus “showing” and “hiding”.

    Hope this helped a little more!

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build

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.