What is wrong with my code?
<p>I have 4 links, when each link is clicked, I am taking the index of that link. I am getting <code>index + 1 = 1, 2, 3 4</code> like this. According to me when user click on the link, the indexed 'li' need to fadeIn, reset have to fadeOut. so, whatever the link is clicked according to the link index + 1 have to fadeIn, rest should not in the view. for this I wrote this code, but not working. what is wrong with my code ?</p>

<pre><code>$('#b-fmg-slider a').each(function(index){
    $(this).click(function(e){
        $('#b-fmg-slider a').removeAttr('class');
        $('#b-fmg-slider ul li').fadeOut();
         $('#b-fmg-slider ul li',':nth-child('+index+1+')').fadeIn();
    })    
})
</code></pre>

<p>can any one say, whether what I am doing here is wrong?</p>

<p>thanks in advance.</p>
