jquery multiple slideshow on one page?
<p>I want to display several slideshow on one page and I have several slides class in my html but by slide is not working. What's wrong with the js code below?</p>

<p>html:</p>

<pre class="lang-php prettyprint-override"><code>&lt;?php
    print("&lt;div class = 'slides'&gt;");
    while($arr = $photo-&gt;fetch_assoc()){
        $url = $arr["url"];
        print("&lt;div&gt;&lt;img src = $url alt = 'piccollection' height = '180' width = '280'/&gt;&lt;/div&gt;");
    }
    print("&lt;/div&gt;");
?&gt;
</code></pre>

<p>js:</p>

<pre class="lang-js prettyprint-override"><code>$(document).ready(function(){
    for(var a = 0; a&lt; $(".slides").size(); a++){
        $(".slides:gt("+a+") &gt; div:gt(0)").hide();
        setInterval(function() {
            $(".slides:gt("+a+") &gt; div:first")
                    .fadeOut(1000)
                    .next()
                    .fadeIn(1000)
                    .end()
                    .appendTo(".slides:gt("+a+")");
            }, 3000);
    }
});
</code></pre>
