Image Sequence order in slider
<p>As per my knowledge I am using the Math in my coding, But the Images and Image Text should be displayed in sequence order, but its displaying randomly. 
The sequence should be Img1,2,3,4,5,6 and then the loop should start from Img1,2,3,4,5,6.</p>

<p>Here is the Demo Link: <a href="http://codebins.com/bin/4ldqp9c/2#" rel="nofollow">http://codebins.com/bin/4ldqp9c/2#</a></p>

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

<pre><code>&lt;div id="panel"&gt;
  &lt;div id="title"&gt;
  &lt;/div&gt;
  &lt;img id="imageSlide" alt="" src="" width="250px"/&gt;
  &lt;div id="desc"&gt;
  &lt;/div&gt;
&lt;/div&gt;
</code></pre>

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

<pre><code>$(function() {
    //Local XML Data
    var slideXML = "&lt;rss version='2.0'&gt;&lt;channel&gt;";
    slideXML += "&lt;title&gt;IMAGES&lt;/title&gt;";
    slideXML += "&lt;images&gt;";
    slideXML += "&lt;image&gt;";
    slideXML += "&lt;title&gt;Image 1&lt;/title&gt;";
    slideXML += "&lt;url&gt;http://www.academy-florists.com/images/shop/thumbnails%5CValentines_Day_flowers.jpg&lt;/url&gt;";
    slideXML += "&lt;desc&gt;Description For Image 1&lt;/desc&gt;";
    slideXML += "&lt;/image&gt;";
    slideXML += "&lt;image&gt;";
    slideXML += "&lt;title&gt;Image 2&lt;/title&gt;";
    slideXML += "&lt;url&gt;http://www.everythingbuttheprincess.com/assets/images/babies-in-bloom-fuchsia-flower_thumbnail.jpg&lt;/url&gt;";
    slideXML += "&lt;desc&gt;Description For Image 2&lt;/desc&gt;";
    slideXML += "&lt;/image&gt;";
    slideXML += "&lt;image&gt;";
    slideXML += "&lt;title&gt;Image 3&lt;/title&gt;";
    slideXML += "&lt;url&gt;http://www.behok.ru/i/a/cat/gerbera.jpg&lt;/url&gt;";
    slideXML += "&lt;desc&gt;Description For Image 3&lt;/desc&gt;";
    slideXML += "&lt;/image&gt;";
    slideXML += "&lt;image&gt;";
    slideXML += "&lt;title&gt;Image 4&lt;/title&gt;";
    slideXML += "&lt;url&gt;http://www.thebutterflygrove.com/images/thumbnails/0/200/200/thumbnail_flower-decor-makpk.jpg&lt;/url&gt;";
    slideXML += "&lt;desc&gt;Description For Image 4&lt;/desc&gt;";
    slideXML += "&lt;/image&gt;";
    slideXML += "&lt;image&gt;";
    slideXML += "&lt;title&gt;Image 5&lt;/title&gt;";
    slideXML += "&lt;url&gt;http://www.thebutterflygrove.com/images/thumbnails/0/200/200/thumbnail_flower-decor-makpk.jpg&lt;/url&gt;";
    slideXML += "&lt;desc&gt;Description For Image 5&lt;/desc&gt;";
    slideXML += "&lt;/image&gt;";
    slideXML += "&lt;image&gt;";
    slideXML += "&lt;title&gt;Image 6&lt;/title&gt;";
    slideXML += "&lt;url&gt;http://gameinfestedent.com/gallery_photo/medium_image/image1322820610_MainPurpleOrchids3_1a.jpg&lt;/url&gt;";
    slideXML += "&lt;desc&gt;Description For Image 6&lt;/desc&gt;";
    slideXML += "&lt;/image&gt;";
    slideXML += "&lt;/images&gt;";
    slideXML += "&lt;/channel&gt;&lt;/rss&gt;";

    //Parse XML content
    var xmlDoc = $.parseXML(slideXML);
    var $xmldata = $(xmlDoc);

    //Find Total No of Image
    var maximages = ($xmldata.find("images").find("image").length);


    $(function() {
        //FadeIn/FadeOut Image on Set Time Interval on Slide
        setInterval(Slider, 2500);
    });

    var prevIndex = 0;

    function Slider() {
        $('#imageSlide').fadeOut("slow", function() {
            var shuffleIndex = Math.round((Math.random() * (maximages - 1)));
            if (prevIndex == shuffleIndex) {
                if (prevIndex &gt;= (maximages - 1)) {
                    shuffleIndex--;
                } else {
                    shuffleIndex++;
                }
            }
            prevIndex = shuffleIndex;
            $("#panel").fadeIn("slow").css('background', '#000');

            var title = $xmldata.find("images").find("image:eq(" + shuffleIndex + ")").find("title").text();
            $("#title").text(title).fadeIn("slow");

            var imgurl = $xmldata.find("images").find("image:eq(" + shuffleIndex + ")").find("url").text();
            $(this).attr('src', imgurl).fadeIn("slow");

            var desc = $xmldata.find("images").find("image:eq(" + shuffleIndex + ")").find("desc").text();
            $("#desc").text(desc).fadeIn("slow");

        });
    }

});
</code></pre>
