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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:33:39+00:00 2026-05-25T18:33:39+00:00

Trying to animate background color on page load but it only works when I

  • 0

Trying to animate background color on page load but it only works when I actually click the element. I am using the colors plugin.

$(window).load(function ()  {  
$(".hilite").toggle(function() {
    $(this).animate({ backgroundColor: "yellow" }, 1000);
},function() {
    $(this).animate({ backgroundColor: "#FFF2A8" }, 500);
});
})

<span class="hilite">THIS should change background COLOR</span>
  • 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-25T18:33:40+00:00Added an answer on May 25, 2026 at 6:33 pm

    As far as I understand, you are trying to do this:

    $(document).ready(function(){ 
        $('.hilite').css({'background-color', 'yellow'});
        $('.hilite').animate({ 'background-color' : "#FFF2A8" }, 1000);
    });
    

    or this:

    $(document).ready(function(){ 
        $('body').animate({ 'background-color': "#FFF2A8" }, 1000);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using JQuery's jquery.animate-colors-min.js plugin I am trying to change the background color of some
I'm trying to animate background-color,color and border color to change with jquery but for
I'm trying to animate an image using KineticJS to move across the screen, but
Simple just trying to animate a p-tag #disclaimer to highlight the background color. Example
I'm trying to make a web page where the background color of an image
I'm trying to change the background color of a div, by using ajax (to
I'm trying to get an element to animate a rotation hover effect using jquery,
I'm trying to animate a private variable named radius, which works. However while its
I'm trying to animate a height property, when hovering, but I can't get it
Possible Duplicate: jQuery animate backgroundColor Is it possible to animate/transition the background-color of a

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.