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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:30:32+00:00 2026-06-18T17:30:32+00:00

The jQuery API documentation for show() states that as of jQuery 1.4.3, one can

  • 0

The jQuery API documentation for show() states that as of jQuery 1.4.3, one can call .show() like so:

.show( [duration ] [, easing ] [, complete ] )

With the arguments being:

  • duration (default: 400): A string or number determining how long the animation will run.
  • easing (default: swing): A string indicating which easing function to use for the transition.
  • complete: A function to call once the animation is complete.

I don’t need easing, so I just call this version:

.show( [duration ] [, complete ] )

I have one function which is supposed to show a div, wait 5 seconds, then fade out over 500ms.

I have tried this:

  $('#some_div').show( {
      duration: 5000,
      complete: function() { fadeOutHelper(500); }
  } );

And this:

$('#some_div').show(5000, function() { fadeOutHelper(500); } );

And in neither case will show() actually wait 5000ms before calling the helper function.

I found a work-around on StackOverflow using setTimeout(): jQuery show for 5 seconds then hide

$('#some_div').show();
setTimeout(function() { fadeOutHelper(500); }, 5000);

Although I have a work-around, I would like to understand how I am misunderstanding some very simple function arguments in the jQuery show() docs.

  • 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-18T17:30:33+00:00Added an answer on June 18, 2026 at 5:30 pm

    I have one function which is supposed to show a div, wait 5 seconds, then fade out over 500ms.

    Do you want to show a div over a period of 5 seconds, or show a div instantly and then wait 5 seconds for a callback? If it’s the former, the second try will work just fine, except that you’ve got an extra } you need to remove. Use some extra white space and it’s obvious:

    $('#some_div').show(5000, function() {
        fadeOutHelper(500);
    }}); // oh noes, synax error
    

    If it’s the latter then the “workaround” you cite is the correct way to implement what you want. setTimeout is not a hack. There is nothing “workaround-ish” about this:

    $('#flash_helper').show();
    setTimeout(function() { fadeOutHelper(500); }, 5000);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The documentation for says that event.stopPropagation shouldn't stop propagation of live events ( http://api.jquery.com/event.stopPropagation
I read that docs.jquery.com uses wiki to do the API documentation. I have been
I have created tabs by using jQuery API and have bound one event handler
I've read the API documentation on .stop()... http://api.jquery.com/stop/ But I'm still confused as to
Hi i am tired googling for jQuery 1.7 API documentation file. Someone please provide
The jQuery documentation lists the following example of using $.getJSON to request JSONP: $.getJSON(http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?,
In the jquery documentation of the empty function (http://api.jquery.com/empty/) there is the following statement:
can any one please tell me why this jQuery function is not working. It
I am trying to query the http://developer.pintlabs.com/brewerydb/api-documentation with jquery.ajax. These are two of the
I am an admitted jquery noob, learning the library via the api documentation and

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.