How do I use jQuery to load a photo?
<p>I am using jquery to display larger images in a window when a thumbnail is clicked. This aspect works very well. However, I have a series of windows and when I close out one window the main image does not load when I open a new window.</p>

<p>I am working on this page: <a href="http://ee.rouviere.com/web/portfolio" rel="nofollow">http://ee.rouviere.com/web/portfolio</a></p>

<p>If you click on any one of the thumbnail images it pops up a window and you can click through the thumbnails. When you close out the window the jQuery clears the values. However, when you click on another thumbnail the main image does not load until you click on one of the thumbnails.</p>

<p>How do I get the main image to load when the window opens?</p>

<p>Here is the jQuery I am using. I began with this:</p>

<pre><code>$("a:has(img.web-port)").click(function() {
    var largePath = $(this).attr("href");
    var caption = $(this).attr("title");
    $(".photo_large").attr({ src: largePath});
    $(".caption1").text(caption);
    return false;
});
</code></pre>

<p>That works great to trigger the larger images. But then I added this because the last main image would not load in the next window that I opened:</p>

<pre><code>$("#fancybox-close").click(function(){
   $(".photo_large").attr({ src: ''});
   $(".caption1").text('');
});
</code></pre>

<p>I would really appreciate some help on this. Operators are standing by to respond promptly to your input.</p>

<p>Thanks!</p>
