title: error jquery elements DOM
body: <pre><code>  var foto = 'htp://midomain.com/folder/pic.jpg';
    var img = new Image();
    $(img).attr({'src': foto, 'width':'100', 'height': '100'})
          .load(function(){
            $(this).hide();                                   
            $(this).fadeIn('slow');
      })
      .click(function(){
        var ancho = 0;
        var img2 = new Image();
        $(img2)
         .attr('src', $(this).attr('src'))
         .load(function(){
              $(this).hide();                                 
              $(this).fadeIn('slow');
              ancho = $(this).width();
              $(img2).attr({'width': $(this).width(), 'height': $(this).height()});
         });
  
  $('body').appendTo(img);
  
  console.log(ancho); //0
  console.log($(img2).attr('width')); //undefined
  //get width img2 :(
  </code></pre>
  
  <p>alguien puede obtener el valor de width and height </p>
  
  <p>someone could help me please, I need to get the width of the element img2</p>
  
  <p>edit:
  I need the original width of the picture
  thanks</p>