幻灯片效果
var index = 1;
var timer;
var picSize = 1;
function showPic(){
for(var i = 1; i < picSize; i++){
var pid = '#pic_gg_' + i;
var id = '#gg_' + i;
if(i == index){
$(pid).css({'display':'block'});
$(id).addClass('dq');
}else{
$(pid).css({'display':'none'});
$(id).removeClass('dq');
}
}
index = index == (picSize-1) ? 1 : index + 1;
}
function stop(i){
clearInterval(timer);
index=i;
showPic();
//setTimeout(start,6000);
}
function start(){
clearInterval(timer);
timer = setInterval(showPic,3000);
}
window.onload = function(){
picSize = 7;
timer = setInterval(showPic,3000);}