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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:58:21+00:00 2026-06-08T20:58:21+00:00

I have this div I want to hide ( display:none ) after it fades

  • 0

I have this div I want to hide (display:none) after it fades out, so I enter this:

$('.element').click(function(){
    $(this).animate({opacity:"0"},{duration:200});
    $(this).delay(200).css('display','none');
});

And I suddenly remember that delay()s don’t work for css. I used to have a little setTimeout fix for this lying around but can’t find it anywhere so I tried random stuff like this:

$('.element').click(function(){
    $(this).animate({opacity:"0"},{duration:200});
});
$('.element').click(function(){
    setTimeout(function(){
        $(this).css('display','none');
    },200);
});

Still doesn’t work. Can someone help me out here 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-06-08T20:58:25+00:00Added an answer on June 8, 2026 at 8:58 pm

    jQuery’s .animate() has a callback feature, you can send an anonymous function to be executed once the animation is done:

    $(this).animate({opacity:"0"},{duration:200}, function(){
       $(this).css('display','none');
    });
    

    source: jQuery animate

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

Sidebar

Related Questions

I have an element, like this: <div id=navleft> </div> I want to make this
I have HTML something like this: <table> <tr> <td><div class='record'>Record Link</div></td> <td><div class='delete' style='display:none;'>Delete
<div class=content id=current> <div id=loader style=display:none;><img src=/images/loader.gif alt= /></div> </div> I have this code.
I have a popup div and want to hide it when users click outside
I have this html-code: <div class=im> <div style=height:220px>HELLO WORLD! <a class=close>X</a> <a class=open style=display:none;>V</a>
So I have this scenario <div id=editor contenteditable=true> <div id=list>Hello</div> </div> I want to
So I have this form <form> <div> <span class=form_t>I Want To Trade In <span
This will hopefully be a simple one: I have a div I want to
I want to do this: I have a div with item: title, image, some
I want align the div to center. like this I have tried margin-top, vertical-align

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.