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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:49:14+00:00 2026-06-17T22:49:14+00:00

I am trying to debug the following script to ensure the best, desired UX.

  • 0

I am trying to debug the following script to ensure the best, desired UX. This script is not working quite as desired, as seen on this fiddle.

    $("ul.menu li").mouseover(function() {
        $(this).find("ul.sub-menu").animate({"opacity": "show"}, 800, "swing");

        $(this).hover(function() {}, function(){
            $(this).find("ul.sub-menu").animate({"opacity": "hide"}, "slow");
        });
    });

As you can see the animations don’t trigger initially. Also if the user accidentally hovers over multiple links then undesired animations get stuck playing for many seconds onward. I want to edit this responsiveness. What are currently some of the top ways to deal with this in professional UI design when working with jQuery and how can I implement these solutions into my script?

  • 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-17T22:49:15+00:00Added an answer on June 17, 2026 at 10:49 pm

    You are nesting mouseover() and .hover() which was the main issue. You just simply want to show something when you hover over it, and then reverse the animation when you hover out.

    Try this: http://jsfiddle.net/pF8wZ/4/

    jQuery(document).ready(function($) {
        $("ul.menu > li").hover(
            function() {
                $(this).find("ul.sub-menu").stop().animate({
                    height: 'toggle',
                    opacity: 'toggle'
                });
            }
        );
    });
    

    I also cleaned up your CSS from the fiddle. You just need this to make the hovering behavior work:

    #access {
    background: #000;
    margin: 0 auto;
    display: block;
    float: left;
        position: relative;
    }
    ul.menu { 
        list-style: none;
        margin: 0;
    }
    ul.menu > li {
        float: left;
        padding: 5px;
        background: #ccc;
    }
    #access ul .sub-menu {
        position: absolute;
        left: 0;
        top: 100%;
        margin: 0;
        width: 200px;
        background-color: #474747;
        -moz-border-radius-bottomleft: 10px;
        -webkit-border-bottom-left-radius: 10px;
        -moz-border-radius-bottomright: 10px;
        -webkit-border-bottom-right-radius: 10px;
        display: none;
    }
    #access ul .sub-menu a {
        background: #333;
        line-height: 1em;
        display: block;
        padding: 3px 5px;
        background-image: -moz-linear-gradient(100% 100% 90deg, #474747, #939393);
        background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#939393), to(#474747));
    }
    

    And the HTML:

    <div id="access">
    <div class="menu-header">
    
    <ul id="menu-wordpress-sandbox-menu" class="menu">
        <li id="menu-item-17" class="menu-item">
            <a href="#">Fruits</a>
            <ul class="sub-menu">
                <li id="menu-item-19" class="menu-item"><a href="#">Oranges</a></li>
                <li id="menu-item-20" class="menu-item"><a href="#">Apples</a></li>
            </ul>
        </li>
        <li id="menu-item-32" class="menu-item">
            <a href="#">Colors</a>
            <ul class="sub-menu">
                <li id="menu-item-30" class="menu-item"><a href="#">Blue</a></li>
                <li id="menu-item-31" class="menu-item"><a href="#">Red</a></li>
            </ul>
        </li>
        <li id="menu-item-33" class="menu-item">
            <a href="#">Links</a>
            <ul class="sub-menu">
                <li id="menu-item-34" class="menu-item"><a href="#">Google</a></li>
                <li id="menu-item-35" class="menu-item"><a href="#">Yahoo!</a></li>
            </ul>
        </li>
    </ul>
    
    </div>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to debug this problem but not sure where exactly i need to
I'm trying to debug the following block of Javascript code to see what the
I am new to shifting bits, but I am trying to debug the following
I'm trying to build freeglut, I just want to debug a bash script option
I am trying to debug a script written for use in BASH. I am
A third-party Python 2.5 script I'm trying to debug has got me stymied. The
I am trying to run an ant build script that compiles GWT. This script
I'm trying to get django-debug-toolbar to work, and after following all the instructions, I'm
I'm trying to get the following Google Apps script to work, taken from another
I'm trying to debug some native code I built using the android ndk-build script

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.