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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:02:28+00:00 2026-06-03T00:02:28+00:00

Consider a div dMyDiv I notice in jquery I can animate so this: $(

  • 0

Consider a div “dMyDiv”

I notice in jquery I can animate so this:

$( "#dMyDiv").animate({
         backgroundColor: "#aa0000"
  }, 1000 );

Brings a red like colored background to my div. But is there a way to then after say 10 seconds
go back to my normal white background of my div? I see there is a callback function but Im not sure if it is possible to start the animation, and once the animation is done to go back to my regular background (before the animation). Should I just do this:

 $( "#dMyDiv").animate({
             backgroundColor: "#aa0000"
          }, 1000, function() {
           $(#dMyDiv").animate({ backgroundColor: "#fff" }, 1000);
          };
);

Meaning after the red animate, just animate again to white?

  • 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-03T00:02:31+00:00Added an answer on June 3, 2026 at 12:02 am

    I was able to do it with this guys:

    http://jsfiddle.net/aN7qz/

    Here is the code:

    $( "#myDiv").animate({ 
                 backgroundColor: "#aa0000" 
              },
                 1000, 
                 function() { 
                     $("#myDiv").animate({ backgroundColor: "#fff" }, 1000);
                 }
                         );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider this snippet: <div> <span style=color:red;>a</span> <span style=color:blue;>a</span> <span style=color:white;>a</span> </div> How can you
Consider I have an anchor which looks like this <div class=res> <a href=~/Resumes/Resumes1271354404687.docx> ~/Resumes/Resumes1271354404687.docx
Consider the following code: $('div').click(function(){ $(this).animate({height:100}, 500) $(this).css({opacity:1}); }); Versus: $('div').click(function(){ $(this).animate({height:100}, 500); })
Consider the following example: HTML: <div id=cool-div></div> JS/jQuery: var ComplexObject = function() { this.Append
Consider the following HTML: <div class=foo id=obj> I should be changed red <div class=bar
Consider this sample code: <div class=containter id=ControlGroupDiv> <input onbeforeupdate=alert('bingo 0'); return false; onclick=alert('click 0');return
Consider the following html code: <div id='x'><div id='y'>Y content</div>X content</div> I'd like to extract
Consider this: <div class=test>one</div> <div class=test>two</div> <script> var i1 = $('.test'); var i2 =
I would like different nested onmousedown events. For example, consider the following code: <div
How can I toggleClass and remove class from all other elements? Consider a div

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.