Creating a XML data thumbnail image slider
<p>I am using a normal data to display the list of images. But the same thing I need is by using the XML. Can anyone please help me. The hardcoded data should be an XML.</p>

<p>This is what I tried so far with normal data:</p>

<p><strong>HTML</strong></p>

<pre><code>&lt;div id="wrapper"&gt;
  &lt;div id="content"&gt;
  &lt;div id="content_left"&gt;

    &lt;ul id="thumb_holder"&gt;

     &lt;li&gt;&lt;a href="javascript:void(0);"&gt;&lt;img src="http://1.s3.envato.com/files/1301249/thumbnail_icon_cloud01.jpg" alt="motherly" /&gt; &lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="javascript:void(0);"&gt;&lt;img src="http://2.s3.envato.com/files/17578109/thumbnail-icons.png" alt="xo" /&gt; &lt;/a&gt;&lt;/li&gt;

    &lt;/ul&gt;
    &lt;/div&gt;

    &lt;div id="large_image_holder"&gt;
      &lt;ul id="large_images"&gt;

         &lt;li&gt;&lt;img src="http://www.tehkseven.net/uploads/dsfiles/img-106910-tn-preview.jpg" alt="motherly" /&gt;&lt;/li&gt;
            &lt;li&gt;&lt;img src="http://www.photoshopessentials.com/images/basics/bridge-cs4/quick-tour/adobe-bridge-cs4.jpg" alt="xo" /&gt;&lt;/li&gt;

      &lt;/ul&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;
</code></pre>

<p><strong>JS</strong></p>

<pre><code>$(document).ready (function(){
    $("#large_images li").each(function(index, element){$(element).attr("class", 'hide');});
    $("#large_images li").each(function(index, element){$(element).attr("id", 'img'+index);});
    $("#thumb_holder li a").each(function(index, element){$(element).attr("rel", 'img'+index);});

    var mainImg ='img0';
    var current = 'img0';

    $('#img0').css('display', 'inline');
    $('#img0').addClass('current');

    $('#thumb_holder li a').click (function(){
        mainImg = $(this).attr('rel');
        if(mainImg != current){
        $('.current').fadeOut('slow');
        $('#'+mainImg).fadeIn('slow', function(){
        $(this).addClass('current');
        current = mainImg;

        });
        }
    });
});
</code></pre>
