title: jquery to find img size and set to div css height and width
body: <p>I am trying to get jquery to find the size of each image (between 8-10 images per page) in an owl carousel. For some reason, in the developer I just get back <code>width 0px, height: 0px</code></p>
  
  <p>here are the elements as they appear from developer:</p>
  
  <pre><code>&lt;div class="item" style="width: 0px; height: 0px;"&gt;
      &lt;img src="url.com/img.jpg" alt=""&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>my jquery:</p>
  
  <pre><code>$('.item').each(function() {
      var $this = $(this),
          w = $this.find('img').width(), 
          h = $this.find('img').height();
      $this.width(w).height(h); 
  });
  </code></pre>
  
  <p>how can i manage jquery to get the size of the image as it loads?</p>