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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:44:18+00:00 2026-05-23T18:44:18+00:00

I am having great difficulty in making the lights on the grid I have

  • 0

I am having great difficulty in making the lights on the grid I have made appear one after the other. At the moment the lights all come on at once but I’m not sure how to make the boxes light up one after the other.

I have pasted the code below:

html:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<LINK REL=StyleSheet HREF="style.css" TYPE="text/css" MEDIA=screen>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"> </script> 
<script language="JavaScript" src="script.js">
</script>
</head>
<body>

<div class="container">
    <div class="box spacing"></div>
    <div class="box spacing"></div>
    <div id="square1id" class="box spacing"></div>
    <div class="box"></div>

    <div class="box spacing"></div>
    <div class="box spacing"></div>
    <div id="square2id" class="box spacing"></div>
    <div class="box"></div>

    <div id="square3id" class="box spacing"></div>
    <div class="box spacing"></div>
    <div id="square4id" class="box spacing"></div>
    <div class="box"></div>

    <div  id="square5id" class="box spacing"></div>
    <div class="box spacing"></div>
    <div id="square6id" class="box spacing"></div>
    <div class="box"></div>
</div>

</body>
</html>

CSS:

 body{
    background-color:#000000;
    margin:0;
    padding:0;
}

h1{
  color:#ffffff;
  text-align:center;
}

.container{
    overflow:hidden;
    width:860px;
    margin-left:250px;
    margin-top:20px;
}
.box{
    width:210px;
    height:120px;
    float:left;
    background-color:#4D4D4D;
    margin-bottom:3px;
}

.spacing{
    margin-right:3px;
}

Script:

  $(document).ready(function(){

    var colourinfo = {
        square1id: [
                    '#000000'
                    ],

        square2id: [
                    '#ffffff'
                    ],
        square3id: [
                    '#FFE600'
                    ],
        square4id: [
                    '#FFE600'
                    ],          
        square5id: [
                    '#FFE600'
                    ],
square6id: [
                    '#FFE600'
                    ]                   

    };

    var count = 0;

    var changecol = function(){
        $.each(colourinfo, function(tileid, colarray){
           $('#'+tileid).css('background-color', colarray[count%colarray.length]);
        }); 
        count++;
    };

    setInterval(changecol, 1000);
});

I would be extremely grateful for any advice on this. Thanks

  • 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-23T18:44:19+00:00Added an answer on May 23, 2026 at 6:44 pm

    The underlying issue is that when changecol is called the first time, it loops through yourcolourinfo data structure and applies all the colors in the first execution.

    I made this jsfiddle that does what I think you want to do now, and maybe what you were planning to do next. It cycles each node through a series of colors one at a time every 100ms.

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

Sidebar

Related Questions

I am having great difficulty making a connection to an Oracle Database OJDBC. Error:
I am having great difficulty reading the API for named scopes. Each bid has
I'm having great difficulty getting my Android application to play videos from the SD
I'm having a great deal of difficulty trying to figure out the logic behind
HI all, I'm having some difficulty understanding the rationale behind group by aggregation in
Ok, I have looked all over and I am having a difficult time trying
I am having a great deal of difficulty with getting rid of the white
I have included the necessary files for the ExtJs calendar. However I'm having difficulty
I am having great difficulty choosing which frameworks to use for an app that
I'm having great difficultly making my DB2 (AS/400) queries case insensitive. For example: SELECT

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.