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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:39:50+00:00 2026-05-30T10:39:50+00:00

Well, this is the exact opposite problem that I normally have with Javascript synchronicity

  • 0

Well, this is the exact opposite problem that I normally have with Javascript synchronicity issues.

This time, I have a jQuery animation running for 10 seconds: Actually, quite a few of them. I know it is bloated!

function spectrum() { 
    hue = (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 128)) + ',' + (Math.floor(Math.random() * 256));  
    $('#dubious').animate({boxShadow: "0px 0px 300px rgba(" + hue + ", 0.8) inset"}, 10000);
    $('.strip').animate({borderColor: "rgba(" + hue + ", 0.25)"}, 10000);
    $('.element').animate({boxShadow: "0px 0px 400px rgba(" + hue + ", 0.45)"}, 10000);
    $('#outer_container').animate({borderColor: "0px 0px 400px rgba(" + hue + ", 0.45)"}, 10000);
    $('#dubious_box').animate({boxShadow: "0px 0px 40px rgba(" + hue + ", 1)"}, 10000, function() {spectrum();});
}

.. basically, it picks a random color, and then each of these elements transitions to that hue over 10 seconds.

Again, probably too bloated to be terribly practical, but its just SO COOL LOOKING..

Anyway, the real problem child is here.

You’ll notice, if you click one of the images in the top row (don’t try clicking the rest, that’s another issue i’m hammering out), and wait for about ten seconds, you’ll get a popup with a blown-up version of the picture. Then click the picture again, and wait ten more seconds, and it’ll finally blink out like a TV.

Anyway, the click event:

$(".gallery_image").click(function() {
        $("#blowup").attr('src',$(this).attr('src'));
        $("#outer_container").animate({opacity: "1", height: "500"});
    });

When I turn off the spectrum() loop, the problem goes away.

Thanks for taking a look 😀

  • 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-30T10:39:52+00:00Added an answer on May 30, 2026 at 10:39 am

    The following code works well, combining insight and code from both @nnnnnn and @Praveen.

    The code is for a gallery that has a looping color-changing animation in the background (When a user clicks a thumbnail, the animation in the background has to stop, the click action takes place, and the background animation kicks in again. The same happens when a user clicks the image or presses Esc to close the image.

    The following code is where all looping background animation animations running on the page (4) stop, then ends one more animation (outer_container) before adding a new animation to its queue.

    After all that, I must ask:

    Is it possible to end all animation on all items with a single line of jQuery? would this be more or less efficient than stopping them all independently?

    $(".gallery_image").click(function() {
            $('#dubious').stop(true); //end all active animations --v
            $('.strip').stop(true);
            $('.element').stop(true);
            $('#dubious_box').stop(true); // --^
            $("#blowup").attr('src',$(this).attr('src'));
            $("#outer_container").stop(true).animate({opacity: "1", height: "500"},
            function() { //callback
                spectrum();
            });
        });
    
        $('#blowup').click(function() {
            $('#dubious').stop(true); //end all active animations --v
            $('.strip').stop(true);
            $('.element').stop(true);
            $('#dubious_box').stop(true); // --^
            $("#outer_container").stop(true).animate({opacity: "0", height: "0"})
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well I have this MySQL stored procedure that I wrote and if I run
I have been trying to solve this problem for hours (searched here as well
I have written a javascript that works well in all browser except Internet Explorer
Well this is incredibly frustrating. After being nagged by Rails that I need to
I hope I can explain this well enough so that you can understand the
I have previously read Spolsky's article on character-encoding, as well as this from dive
well i have this messages table with sample values like these: msg_id recipient_id read
I have created an interface that my DbContext class implements, this enables me to
Well this JSON I have doesn't work on PHP Json_decode, it returns NULL, and
I have almost the same problem as this unanswered question . The only difference

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.