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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:42:26+00:00 2026-05-27T10:42:26+00:00

I have a drop down that I’d like to have fade in opacity upon

  • 0

I have a drop down that I’d like to have fade in opacity upon parent being hovered. I’m using display:none, so I’m not sure if this affects things… I know it does for CSS3 transitions.

  <ul class="headermenu">
                <li><a href="index.php">Index</a></li>
                <li class="topmenu"><a href="#">Parent</a>
                    <div class="submenu">
                        <ul class="sub">
                            <li><a href="#">Drop down 1</a></li>
                            <li><a href="#">Drop down 2</a></li>
                            <li><a href="#">Drop down 3</a></li>
                            <li><a href="#">Drop down 4</a></li>
                        </ul>
                    </div>                  
                </li>
                <li><a href="#">Irrelevant</a></li>
                <li><a href="#">Irrelevant</a></li>
            </ul>

My CSS for parent/child :

.submenu { 
    display:none;
    visibility:hidden;
    opacity:0.0;
}


.topmenu:hover .submenu {
    display:block;
    position:absolute;
    float:left;
    top:25px;
    left:-20px;
    margin:0px;
    padding:10px 10px;
    width:360px;
    height:35px;
    background:none;
    visibility:visible;
    opacity:1.0;

 }

My poor, poor failing JQUERY :

$(document).ready(function() {
    $('.topmenu').each(function() {
        $('.topmenu').hover(function() {
            $('.submenu').stop().animate({ opacity:1.0 }, 700);
        },
       function() {
           $('.submenu').stop().animate({ opacity:0.0 }, 600);
       });
    });
});

Oddly enough, it animates opacity on the 2nd time I hover, but not on hovering out, and I’m sure there’s a better way to accomplish this, I’m just not sure what. Perhaps some of my CSS rules are overwriting my JQuery….

Many thanks SO.

  • 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-27T10:42:26+00:00Added an answer on May 27, 2026 at 10:42 am

    Yea you can way simplify this:

    JQuery:

    $(function(){
        $('.topmenu').hover(function(){
            $(this).children('.submenu').stop().fadeIn(700);
        },function(){
            $(this).children('.submenu').stop().fadeOut(600);
        });
    });
    

    CSS:

    .topmenu {
        position:relative;
    }
    
    .submenu {
        display:none;
        position:absolute;
        top:10px;
        left:20px;
        margin:0;
        padding:10px;
        width:360px;
        background-color:#F0F0F0;
     }
    

    Demo: http://jsfiddle.net/shTyp/

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

Sidebar

Related Questions

Currently have a drop down menu that is activated on a hover (from display:none
I have a drop-down menu that I would like to dynamically update using jQuery.
I'm using classic asp, I have a drop down list that the user selects
I have a drop down menu that looks like this: It works fine, but
I have a mutliple drop down menus that I am using to hide/show rows
I have a drop-down that lists font families. Like Tahoma, Arial, Verdana, etc. I
I have a drop-down menu that are dynamically added through WordPress. It looks like
I have a drop down list that is being used in an EditItemTemplate of
Basically, I have drop down menu that looks like this: <select> <option>0</option> <option selected=selected>1</option>
I have a drop down that is hidden using left:-9999em; and left:0em; on hover/focus

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.