Skip to content

Commit

Permalink
added for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
manu-chroma committed May 14, 2016
1 parent 164496c commit ca3eeef
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@
document.body.style.backgroundColor = newColour[number];
document.getElementById('clipboard').style.background = newColour[number];
document.getElementById('generate').style.background = newColour[number];
document.getElementById('c1').style.background = newColour[number];
document.getElementById('c2').style.background = newColour[(number+4)%5];
document.getElementById('c3').style.background = newColour[(number+3)%5];
document.getElementById('c4').style.background = newColour[(number+2)%5];
document.getElementById('c5').style.background = newColour[(number+1)%5];
var div_id = "c";

for(var i =0 ; i < 5;i++) {
div_id = "c"+(i+1);
document.getElementById(div_id).style.background = newColour[(number+i)%5];
}

document.getElementById('clipboard').setAttribute("data-clipboard-text",newColour[n]);


Expand Down

0 comments on commit ca3eeef

Please sign in to comment.