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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:22:03+00:00 2026-05-26T04:22:03+00:00

I’m working on a site that uses setTimeout() to do kind of a ‘slideshow’

  • 0

I’m working on a site that uses setTimeout() to do kind of a ‘slideshow’ with banners on my site. Everything works fine, I have the delay set to 10 seconds. The problem only occurs when I switch windows/tabs and do something else. When I come back, the function runs a ton of times I (assume) to catch up or something. Problem is, my screen starts flickering over and over to show all banners fading in and fading out.

Any ideas on a solution? I’ve noticed this in Google Chrome, I also know it happens in Firefox. Not sure about IE.

EDIT

Here is the snippet I’m dealing with. Sadly, it is part of a very large script and is connected to a very complicated HTML file.

I hope you can get an idea of what is going on here at least:

var lval=0;
var nval=1;
setHead = function(data) {
        lval=nval;
        var index=1;
        $.each(data, function(name,value) {
            if (Math.floor(Math.random()*index+2)==index+1) {
                nval=index;
            }
            if (index==lval) {
                $('.headmaster').find('img').fadeOut('fast');
                //$('.headmaster').css('background-color',value.backgroundcolor);
                $('.headmaster').find('a').attr('href',value.url);
                $('.headmaster').animate({backgroundColor:value.backgroundcolor},'slow',function() {
                    $('.headmaster').find('img').attr('src',value.img);     
                    $('.headmaster').find('img').fadeIn('slow');                                                                        
                });
            }
            index++;
        });
        setTimeout(function() { setHead(data); },10000);
}

arrayGet = function(arr,idx) {
    $.each(arr, function(i,v) {
        if (i==idx) {
            return v    
        }
    });
    return null
}

$(document).ready(function() {  
    $.getJSON('json/intros.json', setHead);
});

I’m using jQuery for the animation and the color plugin for fading the colors.

  • 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-26T04:22:04+00:00Added an answer on May 26, 2026 at 4:22 am

    It is happening probably because you are using an old version of jQuery. Namely the one where the dev team has started using requestAnimationFrame API. Fortunately, they fixed it in 1.6.3. Here is an extract from their blog:

    No more animation “worm holes”: We had high hopes for the browser’s requestAnimationFrame API when we added support into version
    1.6. However, one of the highest-volume complaints we’ve received since then relates to the way requestAnimationFrame acts when a tab is
    not visible. All the animations initiated when the tab is invisible
    “stack” and are not executed until the tab is brought back into focus.
    Then they all animate at warp speed! We’ve removed support for this
    API (which has no impact on the way you call jQuery’s animation
    features) and plan to incorporate it into a future version of jQuery.

    Simply update to 1.6.4.

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

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.