⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 barnavswitch2.js

📁 一个信息发布系统 基于jsp+servlet+tomcat 用户分管理员跟普通用户 普通用户有发布信息 查询信息 修改信息 回复信息 管理员拥有普通用户的功能 此外还具有删除信息 管理信息的回复的功能
💻 JS
字号:
var barNav = document.getElementById("div_barNav");
var barH2 = barNav.getElementsByTagName("h2");
var barDiv= barNav.getElementsByTagName("div");
var barA= barNav.getElementsByTagName("a");
var navBotton = document.getElementById("h2_navBotton");
var bottonSpan = navBotton.getElementsByTagName("span");

bottonSpan[1].style.display ="none";
for(i=0; i<barH2.length; i++){
	barH2[i].ids = i;
	barH2[i].onclick = function(){	
		for(j=0; j<barH2.length; j++){
			barH2[j].className = "";
		}
		barH2[this.ids].className = "on";

		if(barDiv[this.ids].className==""){
		barDiv[this.ids].className="now";}else{
		barDiv[this.ids].className="";}
	}

}


for(j=0; j<barA.length; j++){
	barA[j].ids = j;
	barA[j].onclick = function(){	
		for(k=0; k<barA.length; k++){
			barA[k].className = "";
		}
		barA[this.ids].className = "on";
}

}


navBotton.onclick = function(){
	if(bottonSpan[1].style.display =="none"){
	bottonSpan[0].style.display ="none"
	bottonSpan[1].style.display ="";

	for(j=0; j<barH2.length; j++){
	barDiv[j].className="now";
		}
	
	}else{
	bottonSpan[1].style.display ="none"
	bottonSpan[0].style.display ="";

	for(j=0; j<barH2.length; j++){
	barDiv[j].className="";
		}

	}



}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -