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

  • Home
  • SEARCH
  • 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 6857631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:02:52+00:00 2026-05-27T02:02:52+00:00

I have the following code: $(document).ready(function() { $(‘#nav li’).hover( function() { // Show the

  • 0

I have the following code:

$(document).ready(function() {
    $('#nav li').hover(

    function() {
        // Show the sub menu
        $('ul', this).slideDown(300);
    }, function() {
        //hide its submenu
        $('ul', this).slideUp(200);
    });

});

But if i rollover an Nav menu item quickly, say 50 times..it will keep showing the animation (up and down) 50 times like a loop!…

I tried adding .stop() like $('ul', this).stop().slideDown(300); – but it just stops the menu showing…. so any ideas where to put it in the code or another way to do it please?

  • 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-27T02:02:53+00:00Added an answer on May 27, 2026 at 2:02 am

    The api for stop says Stop the currently-running animation on the matched elements, which is exactly what you need.

    In the snippet below, i supply the two parameters aswell. These are:

    • clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.
    • jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.

    Usually code should look like (thats how i do myself):

    $(document).ready(function () {     
      $('#nav li').hover(function () {
        // Show the sub menu
        $('ul', this).stop(true,true).slideDown(300);
      }, 
      function () {
      //hide its submenu
        $('ul', this).stop(true,true).slideUp(200);         
      });
    });
    

    EDIT:

    I updated the code and set stop to using true,true instead of true,false, which makes the menu work as intended. It will look at little chunky although, because the second parameter forces the animation to end.

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

Sidebar

Related Questions

I have the following code: $(document).ready(function(){ $(.yearInner).hide(); $(.year, this).hover( function () { $(.yearInner, this).slideToggle();
I have a following code $(document).ready(function(){ //When mouse rolls over $(#nav #nav_li).mouseover(function(){ $(this).stop().animate({height:'140px', width:'182px'},{queue:false,
Under $(document).ready(function() , I have the following code: num = $(#mainContentCategoryLinksWrapper > div).size(); This
I have the following code: $(document).ready(function(){ $(.datepicker).each(function() { $(this).datepicker({ beforeShowDay: function(date){ return [$(this).parent().find(span.days).html(), ]
I have a following code: $(document).ready(function() { $('a[rel]').each(function() { $(this).qtip( { content: { text:
this is my first question here. I have the following jquery code: $(document).ready(function(){ $(a).click(function(){
I have the following code: $(document).ready(function(){ $(.uiCloseButton).click(function(e) { e.preventDefault(); var element = $(this).parents('.uiOverlay'); alert(element);
This solution does not work for IE9. I have the following code: $(document).ready(function() {
I have the following code: $(document).ready(function() { var id = 'cbx'; var idPrefix =
I have the following code $(document).ready(function() { $('a#slick-toggle').click(function() { $('#slickbox0').toggle(400); return false; }); });

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.