Darkijah | I think the issue is in the var place | 16:21 |
---|---|---|
Darkijah | hmm apparently had lost connection | 16:21 |
Darkijah | but just need the script to do it over and over again | 16:21 |
Darkijah | after the last color to redo it | 16:21 |
Darkijah | starting from beginning | 16:21 |
Darkijah | b100dian[m]What is the problem, indexing the listitems?17:37 direc85[m]Try something like: listItems[i].style.color = colors[i % colors.length];18:36 direc85[m]3 minutes too late, it seems :]18:37 b100dian[m]He'll get that from the logs. It's easier to discuss code, ain't it. | 16:22 |
Darkijah | b100dian[m]: you there? | 16:23 |
Darkijah | I just need to redo the colors I would think the code is in the for var code | 16:23 |
Darkijah | but not sure, I just need to have it redo it over and over again | 16:24 |
Darkijah | At the moment I did this | 16:24 |
Darkijah | <script> var listItems = document.getElementsByClassName('color'); var colors = ["#ff0000", "#ff940d", "#e5ff00", "#00ff00", "#25c7ef", "#364aff", "#ba00ff", "#ff0000", "#ff940d", "#e5ff00", "#00ff00", "#25c7ef", "#364aff", "#ba00ff", "#ff0000", "#ff940d", "#e5ff00", "#00ff00", "#25c7ef", "#364aff", "#ba00ff", "#ff0000", "#ff940d", "#e5ff00", "#00ff00", "#25c7ef", "#364aff", "#ba00ff", "#ff0000", "#ff940d", "#e5ff00", "#00ff | 16:24 |
Darkijah | over and over, it works but kinda not... | 16:24 |
Darkijah | the way it should be. | 16:24 |
Darkijah | listItems[i].style.color = colors[i % colors.length]; | 16:27 |
Darkijah | hmmm | 16:27 |
Darkijah | okay | 16:27 |
Darkijah | like this: | 16:28 |
Darkijah | var listItems = document.getElementsByClassName('color'); var colors = ["#ff0000", "#ff940d", "#e5ff00", "#00ff00", "#25c7ef", "#364aff", "#ba00ff"]; for(var i = 0; i < colors.length; i ++) { listItems[i].style.color = colors[i % colors.length]; } | 16:28 |
Darkijah | nope did not seem to work | 16:30 |
Darkijah | stops at the 7 color still | 16:30 |
Darkijah | wait... did it not copy paste it | 16:31 |
Darkijah | listItems[i].style.color = colors[i % colors.length | 16:31 |
Darkijah | Stops.... at the 7 color still b100dian[m] | 16:33 |
Darkijah | I'm sure it is easy to solve, but.... I just don't know Javascript | 16:34 |
Darkijah | Just be a small fixed to make it redo the 7 colors | 16:34 |
Darkijah | Maybe I should go to Israel.... And just take a break from it all... | 16:35 |
Darkijah | southen point and get some sun | 16:35 |
b100dian[m] | Replace colors.length with listitems.length | 17:17 |
Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!