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

141
Visualizações
JQuery .width() doesn't change the width

I have got two divs, one img and one video, which adjusts to the size of the screen automatically. I want my image to be the same width with the video and found this code on the web (.you is the video and .santa is the image):

<script> 
    $( window ).resize(function() {
        $(".santa").width($(".you").width());
    });            
</script>

It does not change the width though.

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

0

It changes the width I wrote an example here for you, to check it just resize the page splitter

<div class="santa" style="width:100px;background-color:red">
santa
  <div class="you" style="width:200px;background-color:green">
    you
  </div>
</div>

$( window ).resize(function() {
  $(".santa").width($(".you").width());
}); 
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