利用Javascript实现下拉菜单导航





下面是脚本:

function show(position){
if (position==1){
    document.getElementById('first').style.display='block';
	document.getElementById('second').style.display='none';
    document.getElementById('third').style.display='none';
}else if (position==2){
    document.getElementById('first').style.display='none';
	document.getElementById('second').style.display='block';
    document.getElementById('third').style.display='none';
}else{
    document.getElementById('first').style.display='none';
	document.getElementById('second').style.display='none';
    document.getElementById('third').style.display='block';
}
}
function hidden(){
    document.getElementById('first').style.display='none';
	document.getElementById('second').style.display='none';
    document.getElementById('third').style.display='none';
}


 

你可能感兴趣的:(Javascript,javascript,class,function,menu,脚本,编程)