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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:16:12+00:00 2026-06-11T00:16:12+00:00

I have two html tables. All cell values are being changed by interval in

  • 0

I have two html tables. All cell values are being changed by interval in 3 seconds.
And also when a cell changes it sets background colour of it according to the cell value which was set in previous cycle. In the mean time a settimeout function is being set to the cells to reset colour of background after 2 seconds.

My problem is every 2 seconds I need to reset colour of the cells but
the setTimeout functions are only working for the last cell.

Note:
In my application every cell is being changed its own cycle so resetting colour of cells must be working for its owner (cell). Not in the same time.

I have created an example in JsFiddle . Can anyone help me?

  • 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-11T00:16:14+00:00Added an answer on June 11, 2026 at 12:16 am

    This is a classical “closure in loop” issue. You already tried to create another inner closure to include the local context but you missed the parameters (and used == to assign instead of compare)

    EDIT: Next time please include your code inside the post and not only in a jsfiddle so that this post can stand for itself without the external reference

                _cellColorTimeouts[obj] = setTimeout((function(_cell, _obj) {
                    return function() {
                        debugger;
                        _cell.css({
                            "background-color":"white",
                            "color":"black"
                        });
    
                        _cellColorTimeouts[_obj] = null;
                        clearTimeout(_cellColorTimeouts[_obj]);
                    };
                })(cell,obj), 2000);
    

    EDIT3: See this fiddle: http://jsfiddle.net/7FXtL/10/

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

Sidebar

Related Questions

I have an HTML document where I have two different tables. One is class
I have two images in the background of my html doc. One positioned top
I have two files: master/newsletter1/file.html master/newsletter2/file.html newsletter1/file.html has a lot of new changes that
Hi all I have suppose two html files in my mobile application say page1.html
I have two tables on my html page with exact same data but there
In my html table I have two row, first row having no css but
In my html page, I have one table, for every row there are two
I have two html pages on my webserver www.example.com/desktop.html www.example.com/mobile.html In principle the content
OK, I have two HTML select elements and a button. I need to disable
I have those two html radio buttons and textarea. I basically want to enable

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.