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

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

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 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!