var indexPos = 0; var totalSlide; var autoSlide; var autoSlide_timeout = 6000; function slideInfo(showInfo) { $('.info').stop(true,true); if(showInfo){ $('.info').animate({ bottom: 0 },200); } else { $('.info').animate({ bottom: -42 },200); } } function updateSlideshow(){ var distance = 0; for(var i=0;i 0){ indexPos--; } else { indexPos = totalSlide; } } else { if(indexPos < totalSlide){ indexPos++; } else { indexPos = 0; } } updateSlideshow(); }); $('.thumb li').click(function(){ clearTimeout(autoSlide); if($(this).index() !== indexPos){ indexPos = $(this).index(); updateSlideshow(); } return false; }); autoSlide = setTimeout("startAutoSlide()",autoSlide_timeout); });