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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:11:35+00:00 2026-05-23T00:11:35+00:00

Can anyone tell me what I’m doing wrong with my dropdown menu? It needs

  • 0

Can anyone tell me what I’m doing wrong with my dropdown menu? It needs to close when I move the mouse away from ‘WEDDINGS’, but it will only close when I move the mouse away from the top menu.

http://www.wedevents.com.au/weddings.asp

Any help will be greatly appreciated.

HTML:

<ul class="topnav">
    <li>
        <a href="http://www.wedevents.com.au/index.asp"> 
        <img src="/images/menu_home.gif" name="home" onMouseOver="over(0)" onMouseOut="out(0)" alt="Home" /></a>
    </li>
    <li>
        <a href="http://www.wedevents.com.au/about.asp"> 
        <img src="/images/menu_about.gif" name="about" onMouseOver="over(1)" onMouseOut="out(1)" alt="About" /></a>
    </li>
    <li class="ddmhover">
        <a href="http://www.wedevents.com.au/weddings.asp"> 
        <img src="/images/menu_weddings.gif" name="weddings" onMouseOver="over(2)" onMouseOut="out(2)" alt="Weddings" /></a>
        <ul class="subnav">
            <li><a href="http://www.wedevents.com.au/grand.asp">Grand Package</a></li>
            <li><a href="http://www.wedevents.com.au/premium.asp">Premium Package</a></li>
            <li><a href="http://www.wedevents.com.au/platinum_beach.asp">Platinum Beach Package</a></li>
            <li><a href="http://www.wedevents.com.au/prestige.asp">Prestige Package</a></li>
            <li><a href="http://www.wedevents.com.au/beach.asp">Beach Package</a></li>
            <li><a href="http://www.wedevents.com.au/garden.asp">Garden Package</a></li>
            <li><a href="http://www.wedevents.com.au/intimate.asp">Intimate Package</a></li>
            <li><a href="http://www.wedevents.com.au/reception.asp">Reception Packages</a></li>
        </ul>
    </li>
    <li>
        <a href="http://www.wedevents.com.au/planning.asp">
        <img src="/images/menu_planning.gif" name="planning" onMouseOver="over(3)" onMouseOut="out(3)" alt="Planning" /></a>
    </li>
    <li>
        <a href="http://www.wedevents.com.au/gallery.asp">
        <img src="/images/menu_gallery.gif" name="gallery" onMouseOver="over(4)" onMouseOut="out(4)" alt="Gallery" /></a>
    </li>
    <li class="ddmhover2">
        <a href="http://www.wedevents.com.au/equipment.asp">
        <img src="/images/menu_equipment.gif" name="equipment" onMouseOver="over(5)" onMouseOut="out(5)" alt="Equipment" /></a>
        <ul class="subnav2">
            <li><a href="http://www.wedevents.com.au/equipment01.asp">Portable Gazebo</a></li>
            <li><a href="http://www.wedevents.com.au/equipment02.asp">Welcome Easel</a></li>
            <li><a href="http://www.wedevents.com.au/equipment03.asp">Wishing Well</a></li>
            <li><a href="http://www.wedevents.com.au/equipment04.asp">Chairs, Covers &amp; Sash</a></li>
            <li><a href="http://www.wedevents.com.au/equipment05.asp">Americana Chairs</a></li>
            <li><a href="http://www.wedevents.com.au/equipment06.asp">Church Pews</a></li>
            <li><a href="http://www.wedevents.com.au/equipment07.asp">Wedding Umbrellas</a></li>
            <li><a href="http://www.wedevents.com.au/equipment08.asp">Handcrafted Pedestals</a></li>
            <li><a href="http://www.wedevents.com.au/equipment09.asp">Bollards &amp; Handrail</a></li>
            <li><a href="http://www.wedevents.com.au/equipment10.asp">Silk Flower Arrangements</a></li>
            <li><a href="http://www.wedevents.com.au/equipment11.asp">Red Carpet</a></li>
            <li><a href="http://www.wedevents.com.au/equipment14.asp">White Carpet</a></li>
            <li><a href="http://www.wedevents.com.au/equipment12.asp">Ceremonial Arch</a></li>
            <li><a href="http://www.wedevents.com.au/equipment13.asp">Instant Marquee</a></li>
        </ul>
    </li>
    <li>
        <a href="http://www.wedevents.com.au/contact.asp">
        <img src="/images/menu_contact.gif" name="contact" onMouseOver="over(6)" onMouseOut="out(6)" alt="Contact Us" /></a>
    </li>
</ul>

CSS: (I copied and modified this…excuse the mess!)

ul.topnav {
    list-style: none;
    padding: 0 85px;
    margin: 0 auto;
    width: 630px;
    height: 36px;
    background: #b09a27;
    font-size: medium;
    text-align: left;
}
ul.topnav li {
    float: left;
    margin: 0;
    padding: 0;
    position: relative; /*--Declare X and Y axis base for sub navigation--*/
}
ul.topnav li  img{
    border: 0;
}
ul.topnav li a{
    padding: 0;
    color: #fff;
    display: block;
    text-decoration: none;
    float: left;
}
/*--ul.topnav li a:hover{
    background: url(/images/ddm_hover.gif) no-repeat center top;
}--*/
ul.topnav li span { /*--Drop down trigger styles--*/
    width: 17px;
    height: 35px;
    float: left;
    background: url(/images/subnav_btn.gif) no-repeat center top;
}
ul.topnav li span.subhover { /*--Hover effect for trigger--*/
    background-position: center bottom;
    cursor: pointer;
}
ul.topnav li ul.subnav, ul.subnav2 {
    list-style: none;
    position: absolute; /*--Important - Keeps subnav from affecting main navigation flow--*/
    left: 0;
    top: 35px;
    /*--background: #333;--*/
    margin: 0;
    padding: 0;
    display: none;
    float: left;
    width: 170px;
    -moz-border-radius-bottomleft: 5px;
    -moz-border-radius-bottomright: 5px;
    -webkit-border-bottom-left-radius: 5px;
    -webkit-border-bottom-right-radius: 5px;
    /*--border: 1px solid #111;--*/
}
ul.topnav li ul.subnav li, ul.subnav2 li {
    margin: 0; padding: 0;
    /*--border-top: 1px solid #252525;--*/ /*--Create bevel effect--*/
    /*--border-bottom: 1px solid #444;--*/ /*--Create bevel effect--*/
    clear: both;
    width: 170px;
}
html ul.topnav li ul.subnav li a, ul.subnav2 li a {
    float: left;
    width: 180px;
    background: #B09A27 url(/images/ddm_right_arrow.gif) no-repeat 10px center;
    padding-left: 20px;
    padding-bottom: 2px;
    padding-top: 2px;
}
html ul.topnav li ul.subnav li a:hover, ul.subnav2 li a:hover { /*--Hover effect for subnav links--*/
    background: #B09A27 url(/images/ddm_right_arrow.gif) no-repeat 10px center;
    color: #d0bd73;
}

JAVASCRIPT: (top half is for WEDDINGS and bottom half is for EQUIPMENT)

$(document).ready(function(){
    $("ul.topnav li.ddmhover").hover(function() { //When trigger is hovered...

        //Following events are applied to the subnav itself (moving subnav up and down)
        $(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on hover

        $(this).parent().hover(function() {
        }, function(){
            $(this).parent().find("ul.subnav").slideUp('slow').stop(true,true); //When the mouse hovers out of the subnav, move it back up
        });
        //Following events are applied to the trigger (Hover events for the trigger)
        }).hover(function() {
            $(this).addClass("subhover"); //On hover over, add class "subhover"
        }, function(){  //On Hover Out
            $(this).removeClass("subhover"); //On hover out, remove class "subhover"
    });
    $("ul.topnav li.ddmhover2").hover(function() { //When trigger is hovered...

        //Following events are applied to the subnav itself (moving subnav up and down)
        $(this).parent().find("ul.subnav2").slideDown('fast').show(); //Drop down the subnav on hover

        $(this).parent().hover(function() {
        }, function(){
            $(this).parent().find("ul.subnav2").slideUp('slow').stop(true,true); //When the mouse hovers out of the subnav, move it back up
        });
        //Following events are applied to the trigger (Hover events for the trigger)
        }).hover(function() {
            $(this).addClass("subhover"); //On hover over, add class "subhover"
        }, function(){  //On Hover Out
            $(this).removeClass("subhover"); //On hover out, remove class "subhover"
    });
});
  • 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-23T00:11:35+00:00Added an answer on May 23, 2026 at 12:11 am
    $(document).ready(function(){
        $("ul.topnav li.ddmhover").hover(function() { //When trigger is hovered...
    
            //Following events are applied to the subnav itself (moving subnav up and down)
            $(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on hover
    
            // Right here you are attaching to .ddmhover's parent ".topnav",
            // not .ddmhover, so it is sliding up when you mouseOut of ".topnav"
            // This should be in a function that is a second parameter to your first
            // .hover() call instead of this...
            $(this).parent().hover(function() {
            }, function(){
                $(this).parent().find("ul.subnav").slideUp('slow').stop(true,true); //When the mouse hovers out of the subnav, move it back up
            });
            //Following events are applied to the trigger (Hover events for the trigger)
            }).hover(function() {
                $(this).addClass("subhover"); //On hover over, add class "subhover"
            }, function(){  //On Hover Out
                $(this).removeClass("subhover"); //On hover out, remove class "subhover"
    });
    

    Updated

    I rewrote it to be more generalized. This way you don’t need to have a separate classname for each drop-down and subnav you create. Instead you just use “.ddmhover” and “.subnav” for them all.

    $(document).ready(function(){
        $("li.ddmhover").mouseover(function() {
            var that = this,
            subnav = $(this).find("ul.subnav"),
            img = $(this).find('img'),
            subnavTimeout;
    
            $(this).addClass("subhover");
            subnav.slideDown('fast');
    
            var hideSubnav = function (evt) {
                // Wait half a second before trying to hide subnav
                subnavTimeout = setTimeout( function () {
                    $(subnav).unbind('mouseleave');
                    $(subnav).slideUp('slow');
                    $(that).removeClass("subhover");
                }, 500);
            };
    
            $(subnav).mouseleave(hideSubnav)
            // since the title image fills the whole .ddmhover li we must attach to the image itself
            $(img).mouseleave(hideSubnav);
    
            // If the mouse entered the subnav don't close the subnav
            $(subnav).mouseenter(function () {
                clearTimeout(subnavTimeout);
            });
        });
    });
    

    We all do it from time to time, but Whenever you find yourself copy/pasting a chunk of code and then changing one or two strings it would be best to instead create a generalized method of dealing with it.

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

Sidebar

Related Questions

Can anyone tell me what I am doing wrong? my comparePasswords() is not working...
Can anyone tell me what I a doing wrong with this code? I am
Can anyone tell me what's wrong in this code: #!/usr/local/bin/python import os import string,
Can anyone tell me how to return multiple values from a function? Please elaborate
Can anyone tell me how to prevent multiple cells from being selected in datagridview
Can anyone tell me how to get file name from editor? I just made
Can anyone tell me why num_chars and num_rows have to be the same? from
Can anyone tell me what is wrong with this? The file is renamed using
Can anyone tell where i am wrong because its just a simple process but
Can anyone tell me that when we scroll or move mkmapview then according to

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.