Re-calling a jquery plugin after dom manipulation
<p>I'm working on a portfolio script which uses dynamic sorting of elements. I have a list of items on the page which can be sorted with jquery. When the user clicks on one of those elements, a large image loads in a specific div on the page. There is a default image loaded at first. What I'd like to do is use slides.js by Nathan Searles to create a slideshow of 2 to 3 images. The issue I'm having is re-calling the script after a new set of images have been loaded into the div. Here's the base code which loads the items in the div.</p>

<pre><code>&lt;div class="slides_container" id="slidesTarget"&gt;
&lt;img src="../javascript/img/slide-1.jpg" width="570" height="270" alt="Slide 1"&gt;
&lt;img src="../javascript/img/slide-2.jpg" width="570" height="270" alt="Slide 2"&gt;
&lt;/div&gt;

&lt;ul class="webbies"&gt;
&lt;li data-id="ab"&gt;&lt;a href="#"&gt;&lt;img src="/Portfolio/temp/webby-andy-clarke.png" width="110" height="110" alt="" /&gt;&lt;/a&gt;
div class="clickContent"&gt;List of images go here&lt;/div&gt;
&lt;/li&gt;

&lt;li data-id="ac"&gt;&lt;a href="#"&gt;&lt;img src="/Portfolio/temp/webby-andy-clarke.png" width="110" height="110" alt="" /&gt;&lt;/a&gt;
div class="clickContent"&gt;List of images go here&lt;/div&gt;           
&lt;/li&gt;
&lt;/ul&gt;

$("ul.webbies li a").click(function(e) {
e.preventDefault();
var content = $(this).next('.clickContent').html();
if(content) $("#slidesTarget").html(content);
});
$("#slides").slides();
</code></pre>

<p>So, based on this example of code (I may have missed some pieces but hopefully you'll get the idea), The initial div loads up the slides.js script to create a nice slideshow. Whe the user clicks on one of the items in the ul.webbies, a new set of images is loaded into #slidesTarget. What I need to do is re-set the slides.js script to create the slideshow based on the new list of images. Hope this makes sense. Thanks in advance for any help/suggestions.</p>
