title: Can't get width of image changed using jQuery
body: <p>I have a page displaying a single image out of a number of images. I have all images stored in a json object (photoarr) so to navigate back and forth I use this function:</p>
  
  <pre><code>function setPhoto(index) {
    var photo = photoarr[index];
    $('#photoId').text(photo.id);
    $('#photo').attr({ 'src': photo.url, 'alt': photo.title });
    $('#photoTitle').text(photo.title);
    $('#photoWidth').text(photo.width);
    $('#photoHeight').text(photo.height);
    $('#photoTitle').width($('#photo').width());
  }
  </code></pre>
  
  <p>My challenge is that when I get to the last line trying to set the <code>#photoTitle</code> width to match the <code>#photo</code> width <code>$('#photo').width()</code> is 0 (zero). </p>
  
  <p>It's as if I need to "flush" the DOM changes I've made to actually get the new image width...</p>
  
  <p>If any of the above makes sense please let me know what to do...</p>
  
  <p>Thanks in advance</p>