The following code is used to implement picture news
Copy Code code as follows:
var index = 0;
var Timer = null;
function Initgallery () {
for (var i=0; i< 4; i++) {
document.getElementById ("Fpic" +i). Style.display = "None";
document.getElementById ("Ftitl" +i). Style.display = "None";
document.getElementById ("Fnum" +i). Style.classname = "Numoff";
}
Startchange ();
SetTimer ();
}
function Startchange () {
index = index% 4;
Changepic (index);
CHANGETITL (index);
Changenum (index);
index++;
}
function Changepic (index) {
for (var i=0; i<4;i++) {
document.getElementById ("Fpic" +i). Style.display = "None";
}
document.getElementById ("Fpic" +index). Style.display = "block";
}
function Changetitl (index) {
for (var i=0; i<4; i++) {
document.getElementById ("Ftitl" +i). Style.display = "None";
}
document.getElementById ("Ftitl" +index). Style.display = "block";
}
function Changenum (index) {
for (var i=0; i<4; i++) {
document.getElementById ("Fnum" +i). ClassName = "Numoff";
}
document.getElementById ("Fnum" +index). ClassName = "Numoff Numon";
}
function Cleartimer () {
This.clearinterval (Timer);
}
function SetTimer () {
Timer = Window.setinterval (Startchange, 3000)
}
function Setindex (index) {
This.index = index;
This.startchange ();
}