Jquery navigation in modal
<p>I am using a modal to display images.</p>

<pre><code> function showPhoto(pictureinfo){ 
 var photo = $('&lt;div id="piccontent"&gt;&lt;/div&gt;');
 var split = (pictureinfo).split("_");
 var title = split[0];
 var albumid = split[1];
 var attachmentid = split[2];
 var wWidth = $(window).width();
 var wheight = $(window).height();
 var dWidth = wWidth * 0.8;
 var datastring = 'albumid='+ albumid +'&amp;attachmentid='+ attachmentid;
 $.ajax({
 url: 'album.php',
 data: datastring,

 success: function(data) {
 photo.html(data).dialog({title: title, width: 'auto', height:'auto',
 close: function(ev, ui) {  
$('.body_wrapper').css({
opacity: 1.0
});
 } ,
        buttons: [{
            text: "Close",
            className: 'cancelButtonClass',
            click: function() {
                photo.dialog('close');
                $('.body_wrapper').css({
                    opacity: 1.0
                });
            }
        }]}) .dialog('open');
  $('.body_wrapper').fadeTo("slow", 0.1);

  $('textarea').autosize();
  $(".comment").watermark('Write a comment');
  }
  });
  };
</code></pre>

<hr>

<p>When you click on a thumb, it returns the above function. And in the results I have Next and Previous link. When clicked on, it returns the next/previous image in the modal.</p>

<pre><code>$('.albumnav').live('click', function(){ 
var picdata = this.id;  
$.ajax({
url: 'album.php',
data: picdata,
success: function(data) {
$('#piccontent').html(data);
}});
});
</code></pre>

<hr>

<p>all is perfect. BUT if I close the modal and try to open it again, when I click on the next/previous link again, firebug shows me the right response BUT the div piccontent is not updating</p>

<pre><code>$('#piccontent').html(data);
</code></pre>

<p>What could prevent that division from updating? Response is straight forward and div exists.</p>

<p>Thank you.</p>
