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

266
Visualizações
get real background color with opacity

console.log($("#box4").css("background-color")); // Solution does not fit
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="box1" style="background-color: blue; opacity: 0.5;">
  <div id="box2" style="background-color: yellow; opacity: 0.5;">
    <div id="box3" style="bacground-color: green; opacity: 0.5;">
      <div id="box4" style="font-size: 30px; padding: 20px; opacity: 0.9;">Aloha</div>
    </div>
  </div>
</div>

Need to get background-color value for id="box4" with JS oder JQ. The real value of the color that the user sees in the browser must be found. Not a CSS value.

You need to either calculate the color change with an opacity value, or some other solution.

If I use the "COLOR PICKER" google chrome plugin, I get the value #a0b0c0, rgb(160, 176, 192).

It is enough if the speech will only work in google chrome.

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