I wrote this jquery slider for my main slider... it doesn't work... can someone tell me why?
Jquery:
function slideSwitch() {
var $active = $('#slideshow IMG.active');
if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
var $next = $active.next().length ? $active.next()
: $('#slideshow IMG:first');
$active.addClass('last-active');
$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass('active last-active');
});
}
CSS:
#slideshow {
position:relative;
height:408px;
width: 1000px;
z-index: 0;
top: 5px;}
#slideshow IMG {
position:absolute;
top:0;
left:0;
opacity:0.0;
width: 1000px;
overflow: hidden;
z-index: 0;}
#slideshow IMG.active {
z-index:0;
opacity:1.0;}
#slideshow IMG.last-active {
z-index:0;}
HTML:
<div id="slideshow">
<!--THE MAIN SLIDER DIV TAG-->
<img src="img1.png" alt="Slideshow Image 1" class="active" />
<img src="img2.png" alt="Slideshow Image 2"/>
<!-- END MAIN SLIDER DIV TAG -->
</div>