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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:26:10+00:00 2026-05-27T17:26:10+00:00

I have a setInterval function that calls a for loop, looping through each HTML

  • 0

I have a setInterval function that calls a for loop, looping through each HTML text item on my page. If there is a text update (checked with AJAX), the html text flashes with flashfunction().

$(document).ready(function() {
    setInterval("html_update(html_text)", 11000);   // influences flash time
});

This works fine for checking updates. But if there is an update, the animation triggers too fast (about 4x as fast as it does OUTSIDE the for loop)!

Here is the code to check an array of html text boxes to see if there is an update. If there is an update, the box will flash:

for (var i=0; i < id_array_len; i++) {
....some AJAX calls here...

if (httpRequest.ResponseText == 'update') {
$("#htmltext").css("background", color);
$("#htmltext").animate( { "opacity" : 0.4 }, 700, function() {
        $("#htmltext"+id).css("background", color);
        $("#meme"+id).animate( { "opacity" : 1 }, 300)
    });
}

Outside the for loop, the animation jQuery works at the correct speed. Inside the for loop, it flashes 4x as quickly…

Please help and thank you!!

  • 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-27T17:26:11+00:00Added an answer on May 27, 2026 at 5:26 pm

    I am a little confused by what ‘too fast’ means, but I suspect that you want to introduce a delay before triggering the animation. You can do that with jQuery’s delay method.

    $('selector').delay(3000).animate({...});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jQuery setInterval function named timerIncrement that times out (stops incrementing the
I have written a javascript function that uses setInterval to manipulate a string every
I have a jQuery function that is running on setInterval(); What I want to
I have a new items badge on a page that I want to update
$(function() { setInterval( function(){clickRight();}, 5000 ); }); I have this function that executes on
So I have a timer that looks like this my_timer = setInterval(function(){ do_something_amazing(); do_more.stuff_here();
I have a function that calls a #notify div. When a user clicks on
I have a jquery plugin that autofreshes the page every 5 mins. (function($) {
Let's say I have a line of code that looks like this: setInterval(ajaxFunction,3000); where
I have a function that calculates the next frame in an animation of various

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.