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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:38:37+00:00 2026-06-04T01:38:37+00:00

I am trying to take an object and have it fade out 5 seconds

  • 0

I am trying to take an object and have it fade out 5 seconds after the document is ready. Then I would like to have another set of functions fire, in my case one that starts adding and easing a set of blocks.

My major problem is the SetTimeout doesn’t have a callback so I can’t run something after it’s done. And that the rest of the code runs when SetTimeout is running.

This is what I have now:

$(document).ready(function() {
                    setTimeout(function() {
                      $('#background-example').fadeOut(2000, function(){
                    });
                      }, 3000); 
                      alert("Hello");   
            });
            </script>

What this does is run a 2000ms fadeOut, 3000ms after the document is ready. However adding the alert, makes the alert run as soon as setTimeout starts because of it’s property of not waiting.

Any suggestions would be great!

  • 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-04T01:38:39+00:00Added an answer on June 4, 2026 at 1:38 am

    That empty function you put in there is a callback that is called after the animation completes. Just move your alert (or any other function call) inside.

    setTimeout(function() {
        $("#background-example").fadeOut(2000, function() {
            alert("All done!");
        });
    }, 3000);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to take an image that I have in a image object and
I'm trying to take a date object that's coming out of my Drupal CMS,
I'm trying to create a custom JSP tag that would take an array object
I have a datagridview with 9 columns. I am simply trying take the value
I am trying to take the user to login page after cookies are cleared.
I'm trying to write some code that will take any object and convert it
I have an object that can take anywhere from a split second to a
I have been trying out the spring-security-facebook plugin and so far its been smooth.
I have an object array that is being passed and then split up into
I'm trying to take a POCO object and update it with Linq2SQL using an

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.