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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:29:13+00:00 2026-06-13T14:29:13+00:00

I know this questions being asked many times already but I can not make

  • 0

I know this questions being asked many times already but I can not make my drop down menu work with what I have so far. The problem appears if I set delay for menu to show, without setTimeout the menu works just fine. Could anyone take a look and suggest the solution please? I am also trying that it works in IE6.

  • Here is the full example with setTimeout:
    http://jsbin.com/owoyon/1/ (bugged, does not work correct, drop downs get stuck, delay is not recognized)

  • here is a working version without setTimeout
    http://jsbin.com/isamay/1/

and here is a code copy:

<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">

<style>
    body {margin:60px; font-family: sans-serif; font-size:12px;}
    ul,ul ul {margin:0;padding:0;} 
    ul li {
        position:relative;
        list-style-type: none;
        padding:5px 0;
        margin:0 10px;
        cursor:pointer;
        border-bottom:1px solid #ddd;
        display:inline-block;
        float:left;     
    }
    .submenu {
        background:#eee;
        display:none;
        position:absolute;
        width:200px;        
        top:25px;
        left:0;
        margin-left:-5px;
    }
    .hover {
        display:block !important;
    }
</style>
</head>
<body>

<nav id="navigation">
<ul>
    <li class="drop">Option 1
        <div class="submenu">
            <ul>
                <li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
                <li>Aliquam tincidunt mauris eu risus.</li>
                <li>Vestibulum auctor dapibus neque.</li>
                <li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
            </ul>          
        </div>
    </li>
    <li class="drop">Option 2
    <div class="submenu">
            <ul>
                <li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
                <li>Aliquam tincidunt mauris eu risus.</li>
                <li>Vestibulum auctor dapibus neque.</li>
                <li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
            </ul>          
        </div>
    </li>
</ul>
</nav>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

<script>

$(document).ready(function(){

    (function(){

        var topNav = $('#navigation'),
            drop = topNav.find('.drop'),
            myTimer;                

        drop.hover(function(){                  
            obj = $(this);                      
            subMenu = obj.find('.submenu');         
            subMenu.addClass('hover');  
            clearTimeout(myTimer);              
        },function(){
            myTimer = setTimeout(function(){                
                subMenu.removeClass('hover');   
            },300);                                             
        });     

    })();   

});



</script>

</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-06-13T14:29:14+00:00Added an answer on June 13, 2026 at 2:29 pm

    I was able to work it out. Demo here http://jsbin.com/owoyon/3/edit

    var topNav = $('#navigation'),
        drop = topNav.find('.drop'),
        myTimer;
    
    drop.hover(function () {
        var obj = $(this);
        var subMenu = obj.find('.submenu');
        clearTimeout(myTimer);
        if (subMenu.hasClass('hover')) {
            //do nothing
        } else {
            drop.find('.submenu').removeClass('hover');
            subMenu.addClass('hover');
        }
    }, function () {
        myTimer = setTimeout(function () {
            drop.find('.submenu').removeClass('hover');
        }, 300);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this kind of questions have been asked already many times before. The
I know this question was being asked many times but I want to be
I know that this question has been asked multiple times already , but I
This may be a very old, many times asked question. But I am not
I know this has been asked a million times before but i still can't
I know this is very similar to a few other questions, but I can't
I know this question's been asked a couple times before, but none of the
I know this question has been asked many times and we have gotten this
I know this question has been asked before, but despite being a fairly experienced
I know this question has been asked a bunch of times. I already have

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.