$(function(){ var cT = 2000, sT = 3000; var index = 0, $img = $('#slide').children('img'), imgLen = $img.length; $img.not(':first').css('opacity','0'); for (var i=0; i'); } var $tN = $('#thum li'); $tN.first().addClass('active'); $tN.click(function(){ $img.stop(); clearInterval(slides); $(this).addClass('active').siblings().removeClass('active'); var number = $(this).index(), $choiceImg = $img.eq(number); index = (number) % imgLen; $choiceImg.siblings().animate({opacity:0},cT); $choiceImg.animate({opacity:1},cT); start(); }); function start(){ slides = setInterval(function(){ var next = (index +1) % imgLen; $tN.removeClass('active').eq(next).addClass('active'); $img.eq(index).animate({opacity:0},cT); $img.eq(next).animate({opacity:1},cT); index = next; },sT + cT); }; start(); }); $(function(){ var cT = 2000, sT = 3000; var index = 0, $img = $('#slide_hot').children('img'), imgLen = $img.length; $img.not(':first').css('opacity','0'); for (var i=0; i'); } var $tN = $('#thum_hot li'); $tN.first().addClass('active'); $tN.click(function(){ $img.stop(); clearInterval(slides); $(this).addClass('active').siblings().removeClass('active'); var number = $(this).index(), $choiceImg = $img.eq(number); index = (number) % imgLen; $choiceImg.siblings().animate({opacity:0},cT); $choiceImg.animate({opacity:1},cT); start(); }); function start(){ slides = setInterval(function(){ var next = (index +1) % imgLen; $tN.removeClass('active').eq(next).addClass('active'); $img.eq(index).animate({opacity:0},cT); $img.eq(next).animate({opacity:1},cT); index = next; },sT + cT); }; start(); }); $(function(){ var cT = 2000, sT = 3000; var index = 0, $img = $('#slide_tsuki').children('img'), imgLen = $img.length; $img.not(':first').css('opacity','0'); for (var i=0; i'); } var $tN = $('#thum_tsuki li'); $tN.first().addClass('active'); $tN.click(function(){ $img.stop(); clearInterval(slides); $(this).addClass('active').siblings().removeClass('active'); var number = $(this).index(), $choiceImg = $img.eq(number); index = (number) % imgLen; $choiceImg.siblings().animate({opacity:0},cT); $choiceImg.animate({opacity:1},cT); start(); }); function start(){ slides = setInterval(function(){ var next = (index +1) % imgLen; $tN.removeClass('active').eq(next).addClass('active'); $img.eq(index).animate({opacity:0},cT); $img.eq(next).animate({opacity:1},cT); index = next; },sT + cT); }; start(); });