下面這段程式碼是用來實現圖片新聞的
function initGallery(){
for(var i=0; i document.getElementById("fPic" i).style.display = "n" o; .getElementById("fTitl" i).style.display = "none";
document.getElementById("fNum" i).style.className = "numOff > 🎜> setTimer();
}
function startChange(){
index = index % 4;
changeTitl(index);
changeNum(index);
index ;
}
for(var i=0; i document.getElementById("fPic" i).style.dis." }
document.getElementById("fPic" index).style.display = "block";}
function changeTitl(index){
for(var i=0; i document.getElementById("fTitl" i).style.dis
function changeNum(index){
for(var i=0; i document.getElementById("fNum" i).ffffclassName = "O 🎜> document.getElementById("fNum" index).className = "numOff numOn";
}
this.clearInterval(Timer);
}
function setTimer(){
Timer = window.setInterval(startChange, 3000)
}
function setIndex(index){
this.index = index;
this.startChange();