Zeleo bih da mi se slideshow zaustavi nakon poslednje slike, tj. da iskljucim loop. Nasao sam ovu scriptu za fade in/out slideshow pa me interesuje moze li se izmeniti....
<script type="text/javascript">
var fadeDuration=1000;
var slideDuration=1000;
var currentIndex=1;
var nextIndex=1;
$(document).ready(function()
{
$('ul.slideshow li img').corner();
$('ul.slideshow li').css({opacity: 0.0});
$("'ul.slideshow li:nth-child("+nextIndex+")'").addClass('show').animate({opacity: 1.0}, fadeDuration);
var timer = setInterval('nextSlide()',slideDuration);
})
function nextSlide(){
nextIndex =currentIndex+1;
if(nextIndex > $('ul.slideshow li').length)
{
nextIndex =1;
}
$("'ul.slideshow li:nth-child("+nextIndex+")'").addClass('show').animate({opacity: 1.0}, fadeDuration);
$("'ul.slideshow li:nth-child("+currentIndex+")'").animate({opacity: 0.0}, fadeDuration).removeClass('show');
currentIndex = nextIndex;
}
</script>
|