Multiple jQuery conflict unsure of why
<p>I am trying to use the same image fader in two different spots on my <a href="http://173.247.253.180/~andrewba/" rel="nofollow">testing site</a>. <strike>The one in the top banner works, and the one in the furthest right sidebar kind of works</strike>They both now do not work. However I believe that the answer below is more or less on the right track and it is a Wordpress "quirk" that is at a fault and I just need a workaround.</p>

<p>If I have a look at it in Chrome's developer tools, the css is transitioning properly. In the browser the first image fails to load, the second image does and then nothing.</p>

<p>I have literally copied and pasted the code from the top of the page to the widget location in the side bar.</p>

<p>I have tried copying and pasting both the jQuery and the CSS adding a 2 onto the end of all declarations to try and create a distinct function, but to no avail.</p>

<p>Am I able to have two of the same jQuery function?</p>

<p><strong>CSS</strong></p>

<pre><code>&lt;style type="text/css"&gt;
/* rotator in-page placement */
div.rotator {
    position:relative;
/*    height:77px;*/
/*    margin-left: 15px;*/
}

div.rotator ul {
    margin: 0;
    padding: 0;
}
/* rotator css */
    div.rotator ul li {
    list-style-type: none !important;
    float:left;
    position:absolute;
    list-style: none;
}
/* rotator image style */   
div.rotator ul li img {
    width: 468px;
}
div.rotator ul li.show {
    z-index:500;
}
&lt;/style&gt;
</code></pre>

<p><strong>PHP</strong> <em>code is the same for both</em></p>

<pre><code>&lt;div class="rotator"&gt;
&lt;ul&gt;
    &lt;li class="show"&gt;&lt;a href="1"&gt;&lt;img src="http://173.247.253.180/~andrewba/images/banners/40779.gif" /&gt;&lt;/a&gt;&lt;/li&gt;
     &lt;li&gt;&lt;a href="2"&gt;&lt;img src="http://173.247.253.180/~andrewba/images/banners/40780.gif"  /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</code></pre>

<p><strong>jQuery</strong> <em>only called once</em></p>

<pre><code>&lt;script type="text/javascript"&gt;
function theRotator() {
    //Set the opacity of all images to 0
    jQuery( 'div.rotator ul li').css({opacity: 0.0});

    //Get the first image and display it (gets set to full opacity)
    jQuery( 'div.rotator ul li:first').css({opacity: 1.0});

    //Call the rotator function to run the slideshow, 6000 = change to next image after 6 seconds

    setInterval('rotate()',6000);

}

function rotate() { 
        //Get the first image
    var current = (jQuery( 'div.rotator ul li.show')?  jQuery( 'div.rotator ul li.show') : jQuery( 'div.rotator ul li:first'));

    if ( current.length == 0 ) current = jQuery( 'div.rotator ul li:first');

    //Get next image, when it reaches the end, rotate it back to the first image
    var next = ((current.next().length) ? ((current.next().hasClass('show')) ? jQuery( 'div.rotator ul li:first') :current.next()) : jQuery( 'div.rotator ul li:first'));

    //Un-comment the 3 lines below to get the images in random order

    //var sibs = current.siblings();
        //var rndNum = Math.floor(Math.random() * sibs.length );
        //var next = jQuery(  sibs[ rndNum ] );


    //Set the fade in effect for the next image, the show class has higher z-index
    next.css({opacity: 0.0})
    .addClass('show')
    .animate({opacity: 1.0}, 1000);

    //Hide the current image
    current.animate({opacity: 0.0}, 1000)
    .removeClass('show');

};

//Ammended based on the Answer.    
jQuery( document).ready(function() {        
        //Load the slideshow
    jQuery('.rotator').each(function() { jQuery(this).theRotator() });
    jQuery( 'div.rotator').fadeIn(1000);
    jQuery( 'div.rotator ul li').fadeIn(1000); // tweek for IE
});
&lt;/script&gt;
</code></pre>
