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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:17:58+00:00 2026-05-17T02:17:58+00:00

I am very new to JS and am trying to modify the JavascriptKit jQuery-based

  • 0

I am very new to JS and am trying to modify the JavascriptKit jQuery-based megamenu system to delay showing the menu until the mouse has been hovering over the anchor object for a specified time.

The problem I am facing right now is that it seems that the clearTimeout that is called on mouseout only suspends the setTimeout, rather than canceling, clearing, resetting it.

At this point I am just showing an alert after a setTimeout call. Currently I have the timeout interval set to 2000 for testing.

As an example, since I have it set to 2 seconds delay right now, if I mouse over the object 4 times for 1/2 second, the 5th time I mouse over the object my test alert box appears instantly.

I thought clearTimeout was supposed to completely destroy the timed event. Why does it appear to only pause the countdown?

teststuff:function(){
    if(jkmegamenu.toggletest==1)
     {
         jkmegamenu.executetimedcommand()
         jkmegamenu.toggletest=0
     }
    else
     {
         //jkmegamenu.executetimedcommandcancel()
         clearTimeout(jkmegamenu.teststuff);
     }
    },

    executetimedcommand:function(){
        if(jkmegamenu.toggletest==1)
        {
            alert('abcde')
        }
    },

    canceltimedcommand:function(){
    clearTimeout(jkmegamenu.teststuff);
},
  • 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-17T02:17:59+00:00Added an answer on May 17, 2026 at 2:17 am

    clearTimeout takes a timer id as a parameter, not a function reference.

    for example, if you’re setting a timeout for jkmegamenu.teststuff, you would do it like this

    // set the delayed call
    var timerID = setTimeout(jkmegamenu.teststuff, 2000);
    
    // cancel it
    clearTimeout(timerID);
    timerID = 0;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm very new in C# world though I'm trying to modify an installer using
I'm very new to the Entity Framework and trying to understand how to best
I'm very new to Django, having never developed on it. I'm trying to develop
I have a lot of legacy code and I am trying to modify very
I am trying to modify the System.Drawing.Printing.PrinterSettings object that I get from the System.Windows.Forms.PrintDialog
I'm just starting experimenting with jQuery and trying to apply it to a very
im very new in cocoa development and I'm trying to load a Window. I
I'm very new to Redmine/Ruby trying to achieve a simple plugin that takes the
I'm very new to silverlight and I'm trying to play a video located in
I'm very new to programming and I am trying to use paperclip to add

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.