这是script01.j新直能分支调二浏页器朋代说,s
window.onload = choosePic;
var adImages = new Array("images/3.jpg","images/2.jpg","images/113.jpg");
var thisAd = 0;
function choosePic() {
thisAd = Math.floor((Math.random() * adImages.length));
document.getElementById("adBanner").src = adImages[thisAd];
rotate();
}
function rotate() {
thisAd++;
if (thisAd == adImages.length) {
thisAd = 0;
}
document.getElementById("adBanner").src = adImages[thisAd];
setTimeout(rotate, 2 * 1000);
}
这是script02.j新直能分支调二浏页器朋代说,s
window.onload = initAll;
function initAll() { var allLinks = document.getElementsByTagName("a"); for (var i=0; i -1) { allLinks[i].onclick = toggleMenu; } } }
function toggleMenu() { var startMenu = this.href.lastIndexOf("/")+1; var stopMenu = this.href.lastIndexOf(".");
var thisMenuName = this.href.substring(startMenu,stopMenu); var thisMenu = document.getElementById(thisMenuName).style; if (thisMenu.display == "block") { thisMenu.display = "none"; } else { thisMenu.display = "block"; }
return false; }