title: Can't get img width and height jQuery
body: <p>I'm totaly confused with this piece of code. When I just load the page <strong>imgWidth1</strong> and <strong>imgHeight1</strong> are both equal to <strong>"0"</strong> But when I resize my window, the code works and <strong>imgWidth1</strong> and <strong>imgHeight1</strong> have the same value as the image dimension.</p>
  
  <p>All help is welcome, thanks.</p>
  
  <pre><code>var imgWidth1 = $("#image-hover-0").outerWidth();
  var imgHeight1 = $("#image-hover-0").outerHeight();
  
  $("#hover-img-0").css("width", imgWidth1 + "px");
  $("#hover-img-0").css("height", imgHeight1 + "px");
  $("#hover-img-0").css("line-height", imgHeight1 + "px");
  
  $(window).resize(function() {
  
      var imgWidth = $("#image-hover-0").outerWidth();
      var imgHeight = $("#image-hover-0").outerHeight();
  
      $("#hover-img-0").css("width", imgWidth + "px");
      $("#hover-img-0").css("height", imgHeight + "px");
      $("#hover-img-0").css("line-height", imgHeight + "px");
  
  });
  </code></pre>