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

449
Views
How can I change the background color of the element?
          //border3
          var revealThree = document.querySelectorAll('.BorderThree');

          for(var i = 0; i < revealThree.length; i++){

            var windowheight = window.innerHeight;
            var revealtop = revealThree[i].getBoundingClientRect().top;
            var revealpoint = 50;

            if(revealtop < windowheight - revealpoint){
              revealThree[i].classList.add('active');
            }
            else{
              revealThree[i].classList.remove('active');
            }
          }

 

I tried creating a border but when I added a js function, the border's background color suddenly became grey when it should only be a border.

Here's the code for CSS:

    .BorderThree{
      width: 300px;
      height: 450px;
      position: absolute;
      top: 900px;
      border-style: solid;
      border-color: azure;
      left: 900px;
      transform: translateY(150px);
      opacity: 0;
      transition: all 2s ease;

    }

.BorderThree.active{
  transform: translateY(0px);
  opacity: 1;
color: #000;
}

and when I tried adjusting the the opacity, the whole border is affected. I'd appreciate your help, thank you.

about 4 years ago · Juan Pablo Isaza
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!