var spacestr = ''; var pics='',txts='',nums=''; var img_w = '891px'; var img_h = '399px'; pics += '
';nums += ''; spacestr += ''; document.write(spacestr); var original = $('.ban1 div'); var current = 0; if(original.length) { function imgOut(){ original.each(function(){ $(this).fadeOut(100); }); } function imgIn(no){ original.eq(no).fadeIn(300); $('#bantit').html(original.eq(no).find('img').attr('title')); } function imgNext(){ clearInterval(runtimer);current++;imgRun(current);autoRun(); } function imgPrev(){ clearInterval(runtimer);current--;imgRun(current);autoRun(); } function imgRun(nextNum){ if(nextNum>=original.length) { nextNum=0; } else if(nextNum<0) { nextNum=original.length-1; } current=nextNum; imgOut();imgIn(current); } function autoRun(){ runtimer=setInterval(function(){imgRun(current+1);},5000); } autoRun(); }