Jquery hide show list
<p>Having few issues with a jquery hide show item.</p>

<p>Got a list of images, want to show the first one but hide the rest and when the user clicks next the current one is hidden and then the next list item is shown.</p>

<p>Been banging head against wall for a while, and there is probably a very easy solution but for some reason I am unable to see it. Would be grateful of any advice.</p>

<pre><code>    $(function() {
    $('#feat&gt;li:gt(0)').hide();
    var $links = $('#feat&gt;li');
    var $item  = $('#feat&gt;li');

    $links.click(function() {
        var $par = $(this);
        $par.slideUp(700, function() {
            var index = $links.index( $par.get(0) )
            $item.eq( index ).slideDown(700);
        }); 
    });
});

    &lt;div id="feature"&gt;
    &lt;ul id="feat"&gt;
        &lt;li&gt;&lt;img src="images/sample.png" /&gt;&lt;a href="#"&gt;Next&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;img src="images/sample2.jpg" /&gt;&lt;a href="#"&gt;Next&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;img src="images/sample.png" /&gt;&lt;a href="#"&gt;Next&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt; 
</code></pre>
