 fade with next and prev buton jquery
<p>i would like to know how to script a little image rotator with fade animation,
i have some divs and i add two buttons next and prev :</p>

<pre><code>&lt;div id="target" class="cible" style="height: 240px;"&gt;   
     &lt;div id="211" class="block" style="display: block;"&gt; &lt;/div&gt;
     &lt;div id="491" class="block" style="display: none;"&gt; &lt;/div&gt;
     &lt;div id="496" class="block" style="display: none;"&gt; &lt;/div&gt;
</code></pre>

<p></p>

<p>and the div with button </p>

<pre><code>   &lt;div id="next" class="next"&gt;&lt;/div&gt;
   &lt;div id="prev" class="prev"&gt;&lt;/div&gt;
</code></pre>

<p>i try with .next() and .prev() and addClass(), functions but i didn't really the mechanism to know the current div. if someone can explain it </p>

<p>thanks</p>

<p>i try this, its works but not really...</p>

<pre><code> $(".next, .prev").click(function() {
var next_visible = $(this).hasClass(".prev") ? 
        $(".block:visible").prev(".block") : 
        $(".block:visible").next(".block");
$(".block").hide();
next_visible.show();
   });
</code></pre>
