Logic for JQuery Slideshow
<p>I want to implement a vertical slide show using JQuery. I am using a vertical reel(div) which in turn contains images one by one i am decrementing the the reel Top position by image size every 2 second which is working fine but when i reach to the last image i am not able to implement the logic to start the reel from first images. if my explanation is not clear i am appending my code:</p>

<pre><code> &lt;script type="text/javascript"&gt;
    $(function() {
        setInterval(SlideImage, 2000);
    });

    function SlideImage() {
        $("#imgReel").animate({ "marginTop": "-=300px" }, 1000, function() { });
    }
&lt;/script&gt;

&lt;style type="text/css"&gt;
    img
    {
        width: 600px;
        height: 300px;
    }
    .imgContainer
    {
        overflow: hidden;
        width: 620px !important;
        height: 300px !important;
    }
    div
    {
        width: 620px;
    }
    .current
    {
        z-index: 0;
    }
    .next
    {
        z-index: 1;
    }
    .imgReel
    {
        width: 620px !important;
    }
    .
&lt;/style&gt;
</code></pre>

<p></p>

<pre><code>&lt;body&gt;
&lt;div id="imgContainer" class="imgContainer"&gt;
    &lt;div id="imgReel" class="imgReel"&gt;
        &lt;div class="current"&gt;
            &lt;img src="Images/Summerwave.jpg" /&gt;
        &lt;/div&gt;
        &lt;div&gt;
            &lt;img src="Images/Sunlight_and_the_Wild_Forest_Floor.jpg" /&gt;
        &lt;/div&gt;
        &lt;div&gt;
            &lt;img src="Images/Sunset.jpg" /&gt;
        &lt;/div&gt;
        &lt;div&gt;
            &lt;img src="Images/Swimming_with_the_fishys.jpg" /&gt;
        &lt;/div&gt;
        &lt;div&gt;
            &lt;img src="Images/Tearing_Apart.jpg" /&gt;
        &lt;/div&gt;
        &lt;div&gt;
            &lt;img src="Images/Teaser.jpg" /&gt;
        &lt;/div&gt;
        &lt;div&gt;
            &lt;img src="Images/Terra_Nova.jpg" /&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p></p>

<p>Any help would be greatly appreciated</p>
