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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:34:53+00:00 2026-06-14T17:34:53+00:00

I have created a simple dropdown menu using CSS and want to create a

  • 0

I have created a simple dropdown menu using CSS and want to create a fadein with jQuery. The fadein works, but only after you hover over the list element twice. The first hover has no fadein effect.

Here is the HTML code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">


<head>
    <title>dropdown_2</title>


    <link href="css/dropDrownNav.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>

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

            $("#nav li").has("ul").hover(function () {
                $(this).addClass("current").children("ul").fadeIn(500);
            }, function () {
                $(this).removeClass("current").children("ul").stop(true, true).css("display", "none");
            });

        });
</script>


</head>
<body>

   <!--begin added nav-->
    <div id="main-navigation" >
        <div id="nav">
        <ul>
            <li class="first"><a href="#">Home</a>
            <ul>
                <li><a href="#">Home1</a></li>
                <li><a href="#">Home2</a></li>
                <li><a href="#">Home3</a></li>
            </ul>
            </li>
            <li><a href="#">About Me</a>
            <ul>
                <li><a href="#">About Me1</a></li>
                <li><a href="#">About Me2</a></li>
                <li><a href="#">About Me3</a></li>
            </ul>
            </li>
            <li><a href="#">Portfolio</a>
            <ul>
                <li><a href="#">Web</a></li>
                <li><a href="#">Print</a></li>
                <li><a href="#">Photos</a></li>
            </ul>
            </li>
            <li><a href="#">Contact Me</a>
            <ul>
                <li><a href="#">Contact Me1</a></li>
                <li><a href="#">Contact Me2</a></li>
                <li><a href="#">Contact Me3</a></li>
            </ul>
            </li>
        </ul>
        </div>
    </div><!--end main navigation-->
    <!--end added nav-->

</body>
</html>

CSS Code:

*{ margin:0px; padding: 0px; }

#nav {
     font-family: arial, sans-serif;
     position: relative;
     width: 390px;
     height:56px;
     font-size:14px;
     color:#000;
     margin: 0px auto;
}

#nav ul {
     list-style-type: none;
}

#nav ul li {
     float: left;
     position: relative;
}

#nav ul li a {
     text-align: center;
     border-right:1px solid #000;
     padding:20px;
     display:block;
     text-decoration:none;
     color:#000;
}

#nav ul li ul {
     display: none
}

#nav ul li:hover ul {
     display: block;
     position: absolute;
}

#nav ul li:hover ul li a {
     display:block;
     background:#12aeef;
     color:#ffffff;
     width: 110px;
     text-align: center;
     border-bottom: 1px solid #f2f2f2;
     border-right: none;
}

#nav ul li:hover ul li a:hover {
     background:#6dc7ec;
     color:#fff;
}

Link to a working example.

Thanks,
Ken

  • 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-14T17:34:55+00:00Added an answer on June 14, 2026 at 5:34 pm

    Try removing the display:block from this line of css…

    #nav ul li:hover ul {
     display: block;
     position: absolute;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using jQuery to create a simple, but large dropdown menu. I have some
i want to create a simple dropdown menu with div but i have this
I've created a simple CSS drop down menu, problem is that I have a
Could someone help me on this, I have created simple web services using axis2
How to manually create Friendly URLs? (PHP) So I have created simple php file
I have created this simple program to learn shared_ptr using namespace std; #define Yes
I have created a simple JQuery script with hovering effect on some links. The
I've got a simple dropdown menu that I want to hide whenever you click
So I created a simple menu for a small project I have. When people
I have created a simple drop-down menu in PHP: <td> Privilege: </td> <td><select name=privilege>

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.