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

457
Visualizações
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
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