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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:33:18+00:00 2026-05-19T01:33:18+00:00

i am very new at jquery and code, here i am trying to get

  • 0

i am very new at jquery and code, here i am trying to get the setTimeout event to be inside the .mouseout event but i’m not sure how to do that as i keep getting syntax error in my editor. Here’s what i have:

jQuery(document).ready(function() {
    $('.slidedown').hide(); 
    $('.trigger').hover( function(){ // enter animation

    $('.slidedown').stop(true,true).animate({
        height: ['toggle', 'swing'],
        }, 600, function() { /* animation done */ });

    }, function(){ // leave animation


$('.slidedown').mouseout()
    setTimeout( function(){
      $('.slidedown').stop(true,true).animate({
        height: '0px',
        }, 600, function() { /* animation done */ });
    }, 1000 );

  });
});

A small nuance, in this code the user mouses over a div, then another div bellow it slides down. Moving the mouse to the .slidedown div should keep it open until the mouse is removed. But will this code collapse the .slidedown div if the user doesn’t mouse over .slidedown after .trigger but instead moves the mouse directly from .trigger to another area of page? I.e i need some kind of ‘setTimeout’ that is trigged only if the user doesn’t move mouse over .slidedown after hovering over .trigger. Hope i make sense. Thanks for your help!

  • 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-19T01:33:19+00:00Added an answer on May 19, 2026 at 1:33 am

    This line is the problem

    $('.slidedown').mouseout()
    

    It shoule be

    $('.slidedown').mouseout( YOUR_CALLBACK_FUNCTION )
    

    You should pass a callback function which will act as an event handler and inside that event handler you can call setTimeout() the way you have done it.

    So the correct code would look like this

    $('.slidedown').mouseout( function() {
       setTimeout( function(){
          $('.slidedown').stop(true,true).animate( {
              height: '0px',
             }, 
             600, 
             function() { /* animation done */ } 
          ); // animate ends here
       }, 1000 ); // setTimeout ends here
    }); // mouseout ends here
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

REVISED CODE AT THE END I'm very new to jquery, and even though I
I am new to JQuery. I am trying to add some code in my
I'm very new to both the Mvc framework as well as JavaScript and JQuery.
Im very new to SQL but need to write a query to do the
I'm VERY new to WPF, and still trying to wrap my head around binding
Warning - I am very new to NHibernate. I know this question seems simple
I still very new using Subversion. Is it possible to have a working copy
I am very new to creating webservers - and I have had several goes
I am VERY new to ASP.NET. I come from a VB6 / ASP (classic)
I am very new to the entity framework, so please bear with me... How

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.