Hello,
I am trying some code I found on the net for a fade in/ fade out slideshow.
It is working fine on FF, Chrome and Safari on Windows.
On Chrome Mac, the slides appearing one below the other, on IE8 on Windows, the text under the slide, does not fade, it just displays all the text above each other.
The jquery code:
function slideSwitch() {
var $active = $('#slideshow div.active');
if ( $active.length == 0 )
$active = $('#slideshow div:last');
var $next = $active.next().length ? $active.next()
: $('#slideshow div:first');
$active.addClass('last-active')
.animate({opacity : 0.0}, 1000);
$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass('active last-active');
});
}
$(function() {
setInterval( "slideSwitch()", 5000 );
});
The css:
#slideshow {
position: relative;
width: 212px;
height: 210px;
border: 1px solid #aaa;
background: #fff;
}
#slideshow div {
position: absolute;
top: 0;
left: 0;
z-index: 8;
opacity: 0.0;
}
#slideshow div.active {
z-index: 10;
opacity: 1.0;
}
#slideshow div.last-active {
z-index:9;
}
p.slideTitle {
color: #aaa7a7;
font-weight: bold;
padding-top: 10px;
text-align: center;
}
The html:
<div id="slideshow">
<div class="active"><a href="index.php?content=judaicart"><img src="images/slide/1.jpg" alt="" /></a>
<p class="slideTitle">1 / <span class="red">Judaic Art</span></p>
</div>
<div><a href="index.php?content=judaicart"><img src="images/slide/2.jpg" alt="" /></a><p class="slideTitle">2 / <span class="red">Judaic Art</span></p></div>
<div><a href="index.php?content=judaicart"><img src="images/slide/3.jpg" alt="" /></a><p class="slideTitle">3 / <span class="red">Judaic Art</span></p></div>
<div><a href="index.php?content=judaicart"><img src="images/slide/4.jpg" alt="" /></a><p class="slideTitle">4 / <span class="red">Judaic Art</span></p></div>
<div><a href="index.php?content=judaicart"><img src="images/slide/5.jpg" alt="" /></a><p class="slideTitle">5 / <span class="red">Judaic Art</span></p></div>
</div>
Can anyone please help me solve this? I'm not an expert on Jquery so any help would be very appriciated.