Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

185
Visualizações
Changing CSS Styles Based On Varying Time Increments

I haven’t started this yet… But I’d like to get some input on this because I am just beginning with coding and I thought getting some different ideas before I start tomorrow will be valuable…

I’m trying to make a list of topics that cycle in colour (active/inactive) one by one from top to bottom based off of varying time data.

How would you go about this?

The time data is stored in a Firebase collection with each doc containing a topic and the time data. The topics are being automatically inserted into the page using a forEach function - into ls tags. I am not asking for help with the Firebase/Firestore side of things.. Just the JavaScript.

I’m using JavaScript to do all the work atm and are not too keen on using anything else because I’m not familiar with coding enough to take on a new language atm.

My thinking is having the JavaScript cycle through the time data one by one and when each time has elapsed it changes the CSS class of each ls tag from active to inactive and vice versa. But I’m not sure how to do the JavaScript time based cycling part. Changing the CSS I’m able to do

What are your thoughts? How would you do this and do you have any advice for me?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If you want to just change if than you can do something like this.

var time = 5000; //time from database
setTimeout(() => {
  //changeColor function
  console.log("Color changed");
}, time) //time in milliseconds

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda