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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:33:05+00:00 2026-06-03T16:33:05+00:00

I am wanting to use settimeout to delay the closing of the menu slightly

  • 0

I am wanting to use settimeout to delay the closing of the menu slightly so they don’t disappear quite so fast on mouseout. I know the syntax would be setTimeout(‘some action’, 350); however since it’s css, I’m not sure where to apply the mouseout and what the function would be. http://jsfiddle.net/hCVjK

Here is the html:

<div id="navigation">
    <ul class="top-level">
        <?php $query = "select * from categories";                              
        $categories = mysql_db_query ($dbname, $query, $link); 
        while ($row= mysql_fetch_array($categories)) { ?>
        <li><a href="<?php echo $site_url;?>/<?php echo $row['category_url'];?>.php"><?php echo $row['category_name'];?></a>
            <ul class="sub-level">
                <?php $query = "select * from subcategories WHERE category_number = '".$row['category_number']."' ORDER BY subcategory_name ASC";
                $subcategories = mysql_db_query ($dbname, $query, $link); 
                while ($row2= mysql_fetch_array($subcategories)) { ?>
                <li><a href="<?php echo $site_url;?/subcat_lookup.php?c=<?php echo $row['category_number'];?>&s=<?php echo $row2['subcategory_name'];?>"><?php echo $row2['subcategory_name']; ?></a></li>
                <?php }?>
                <li><a href="<?php echo $site_url;?>/<?php echo $row['category_url'];?>.php">View all for <?php echo $row['category_name'];?></a></li>
            </ul>
        </li><?php }?>
    </ul>
</div>

Here is the CSS:

#navigation {  position:absolute;font-size:0.75em; width:214px;top:115px;}
#navigation ul {margin:0px; padding:0px;}
#navigation li {list-style: none;} 
/* FIRST LEVEL TEXT/BACKGROUND/BORDER SETTINGS */
ul.top-level {background:#fff;}
ul.top-level li {
 font-family: arial, sans-serif;
 font-size:14px;
 font-weight:bold;
 border:1px solid #D2D2D2; border-color:#fff #A5A5A5 #A5A5A5 #A5A5A5;
background:#fff url(images/arrow.gif) no-repeat center right;
}
/* FIRST LEVEL TEXT COLOR */
#navigation a {
 text-align:left;
 display:block;
 color: #<?php echo $tab_color;?>;
 cursor: pointer;
 line-height: 25px;
 text-indent: 10px;
 text-decoration:none;
 width:214px;
}
/* FIRST LEVEL TEXT HOVER COLOR */
#navigation a:hover{
 text-decoration:none;
}
/* FIRST LEVEL HOVER BACKGROUND COLOR */
#navigation li:hover {
 background-color:#<?php echo $tab_color;?>;
 position: relative;
}
#navigation li{
 background-color:#FFF;
 position: relative;
}
/* SECOND LEVEL TEXT SETTINGS */
ul.sub-level li a{
    font-family: arial, sans-serif;
    font-size:12px;
    font-weight:normal;
    background-color:#FFF;
}
ul.sub-level {
    display: none;
}
li:hover .sub-level {
    position: absolute;
    display: block;
    background: #FFF;
    border: #A5A5A5 solid;
    border-width: 1px;
/* set the sub menu flyout position here */
    left: 207px;
    top: -15px;
    z-index:10;
}
/* SECOND LEVEL TEXT HOVER COLOR */
#navigation ul li ul li a:hover{
 color:#FF6633;
 text-decoration:underline;
}
#navigation ul ul{
    padding-top:5px;
    padding-bottom:5px;
    border-radius: 8px;
    -moz-border-radius: 8px;
    -webkit-border-radius: 8px;
     box-shadow: 0px 3px 10px #B0B0B0;
}
#navigation ul li ul li a{
     text-indent: 20px;
     line-height: 17px;
}
ul.sub-level li {
    background:#fff;
    border:none;
    float:left;
}
/* FIRST LEVEL HOVER BACKGROUND COLOR WHEN IN CHILD NODE*/
#navigation li:hover > a{
    color:#fff;
}
  • 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-03T16:33:06+00:00Added an answer on June 3, 2026 at 4:33 pm

    I modified your fiddle. Here is a jQuery solution. http://jsfiddle.net/hCVjK/3/

    $('ul.sub-level').css('display', 'none'); 
    
    $('ul.top-level > li').hover(function(){
        $(this).find('> ul').show(); 
    }, function(e){
        var t = e.relatedTarget.nodeName; 
        if(t === 'LI' || t === 'A'){
            $(this).find('> ul').hide();
        }else{
            $(this).find('> ul').fadeOut('fast');
        }
    }); ​
    

    I also changed li:hover .sub-level { to .sub-level { in your css

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

Sidebar

Related Questions

I'm wanting to use a plugin know as dropdown-check-list: http://code.google.com/p/dropdown-check-list/ However, some of its
I'm wanting to use a php variable as the destination email for Amazon SES
I'm wanting to use two Objective-C libraries in a MonoTouch app: the Facebook library
I am wanting to use jquery to do a show/hide of a DIV from
I'm wanting to use the jquery dialog to open a modal dialog, and in
When dealing with a series of numbers, and wanting to use hash results for
Stuck on KVCs in Obj-C again. I am wanting to use KVC to find
Here is the jsFiddle: http://jsfiddle.net/JFwDw/2/ What I'm wanting to do is use links to
I'm wanting to use DatagramSocket and DatagramPacket to talk between two Android devices. Looking
I'm wanting to use http_build_query to change an array to html tag properties. Problem

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.