Changing background on different parts of 3 x 3 grid
I have a 3 x 3 grid - each part of the grid has a different background image. I would like to change 1 section of the grid background after say 5 seconds - fade in a new background. Three seconds later I would like a different random part of the grid to change its background.
The following html, css and jQuery changes the background image on each container but to the same background - not what I'm trying to achieve - any help would be greatly appreciated.
Here is the html:
- <body>
- <div class="grid">
- <div class = "row1">
- <div class = "container column1"></div>
- <div class = "container column2"></div>
- <div class = "container column3"></div>
- </div><!--end of row -->
- <div class = "row2">
- <div class = "container column1"></div>
- <div class = "container column2"></div>
- <div class = "container column3"></div>
- </div><!--end of row -->
- <div class = "row3">
- <div class = "container column1"></div>
- <div class = "container column2"></div>
- <div class = "container column3"></div>
- </div><!--end of row -->
- </div>
- </body>
This the css so far - I have only put a background on the top left so far
- * {
- margin: 0px;
- padding: 0px;
- box-sizing:border-box;
- }
- .grid {
- margin-left: auto;
- margin-right: auto;
- width: 900px;
- height: 300px;
- background-color:#22F501;
- }
- .container {
- float: left;
- width: 300px;
- height: 300px;
- background-color: #E4F903;
- border-top: 20px solid #B6B6B6;
- border-right: 20px solid #B6B6B6;
- border-bottom: 20px solid #B6B6B6;
- }
- .container:first-child {
- border-left: 20px solid #B6B6B6;
- }
- .row1 .column1 {
- background-image: url(images/maatariki_main.jpeg);
- background-size: 280px 280px;
- background-repeat: no-repeat;
- }
This jQuery will change the background but it will change it for all of the containers to the same background -p not the desired result.