Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

183
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!