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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:16:16+00:00 2026-06-06T20:16:16+00:00

I am using jQuery to animate the background colors of 3 different divs, repeated

  • 0

I am using jQuery to animate the background colors of 3 different divs, repeated to make a 3×3 grid. All’s well except the hover out/stop animation seems to quit working if the hover time is extended past a second.

If you hover for one second and move out, the colors freeze in place as desired. However, hovering an extended amount of time seems to break the hover-out/stop function.

Can someone help to explain how the hover/stop function works when trying to control multiple functions simultaneously?

As the only way to show working jQuery is via JSfiddle, I’ve linked to the a working example here: http://jsfiddle.net/Commandrea/KbLDq/3/

        function pixelColors(){
    var color = '#'+(Math.random()*0xFFFFFF<<0).toString(16);

    $('.logo').animate({
    backgroundColor: color
    }, 1000, pixelColors);

    }

    function pixelColors2(){
    var color = '#'+(Math.random()*0xFFFFFF<<0).toString(16);

    $('.logo2').animate({
    backgroundColor: color
    }, 2000, pixelColors2);

    }

    function pixelColors3(){
    var color = '#'+(Math.random()*0xFFFFFF<<0).toString(16);

    $('.logo3').animate({
    backgroundColor: color
    }, 1500, pixelColors3);

    }


    $('#logo_back').hover(
    pixelColors,
    function() {
    $('.logo').stop()
    }
    );

    $('#logo_back').hover(
    pixelColors2,
    function() {
    $('.logo2').stop()
    }
    );

    $('#logo_back').hover(
    pixelColors3,
    function() {
    $('.logo3').stop()
    }
    );


    .header {
    position: relative;
    margin: 0 auto;
    }


    #home_header {
    position: relative;
    z-index: 7;
    }

    .pixCol {
    float: left;
    height: 288px;
    margin-right: 20px;
    margin-top: 12px;
    min-height: 1px;
    padding-left: 15px;
    width: 227px;
    }



    #pixelBox {
    left: 14px;
    position: relative;
    top: 20px;
    }

    .logo {
    height: 69px;
    width: 69px;
    z-index: 8;
    background-color:#9C3;
    display:inline-block;
    float:left;
    background-color:#F60;
    }


    .logo2 {
    height: 69px;
    width: 69px;
    z-index: 8;
    background-color:#9C3;
    display:inline-block;
    float:left;
    background-color:#F90;
    }

    .logo3 {
    height: 69px;
    width: 69px;
    z-index: 8;
    background-color:#9C3;
    display:inline-block;
    float:left;
    background-color:#F33;
    }

    .logo_back{
    background:none;
    height: 220px;
    margin-top: 51px;
    position: absolute;
    width: 229px;
    z-index: 9;
    }

    .logo_back2 {
    background: url("images/logo/batterEmpty.png") no-repeat scroll 0 0 transparent;
    height: 220px;
    margin-top: 51px;
    position: absolute;
    width: 229px;
    z-index: 9;
    }

    ​


    <div class="header">
    <div class="pixCol">
    <div id="home_header">
    <div id="logo_back" class="logo_back"></div>
    <div id="pixelBox">

    <div class="logo"></div>
    <div class="logo2"></div>
    <div class="logo3"></div>
    <div class="logo3"></div>
    <div class="logo"></div>
    <div class="logo2"></div>
    <div class="logo2"></div>
    <div class="logo3"></div>
    <div class="logo"></div>

    </div>
    </div>
    </div>
    </div>
    ​
  • 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-06T20:16:17+00:00Added an answer on June 6, 2026 at 8:16 pm

    I’m pretty confused by your code, why are you kicking off 3 animations at the same time? [edit: Oh I see they’re on different elements] Regardless, that’s why it’s not stopping – you have to call stop(true) to stop queued animations as well, and since you’re constantly firing 3 animations at the same time, there are plenty of animations in the queue. Just pass true and your fiddle works fine.

    • 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 have a few divs that I want to animate using jQuery. However, I
I want to use .animate to change colors when .bind('click') is fired, using jquery
All, I am trying create a 'to & fro' animation using jquery animate &
I'm trying to get an element to animate a rotation hover effect using jquery,
I'm using jquery animate() to pull values from svg markup, and create an animation.
I am trying to find a way to animate a div using jQuery to
I have the following Javascript code (using jQuery): floatUpAndDown(); function floatUpAndDown() { $(#bird).animate({top: '+=30px'},
I'm using this jQuery to hide a DIV: $(#slider).click(function() { $(.help).slideToggle(); $(#wrapper).animate({ opacity: 1.0
I've got a div being animated on hover (I'm using jquery's .hover() method). The

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.