求解释下面这段JS代码的意思,我是刚接触JS的.
求解释下面这段JS代码的意思,我是刚接触JS的.
//初始化
var def="1";
function mover(object){
//主菜单
var mm=document.getElementById("m_"+object);
mm.className="m_li_a";
//初始主菜单隐藏效果
if(def!=0){
var mdef=document.getElementById("m_"+def);
mdef.className="m_li";
}
//子菜单
var ss=document.getElementById("s_"+object);
ss.style.display="block";
//初始子菜单隐藏效果
if(def!=0){
var sdef=document.getElementById("s_"+def);
sdef.style.display="none";
}
}
function mout(object){
//主菜单
var mm=document.getElementById("m_"+object);
mm.className="m_li";
//初始主菜单
if(def!=0){
var mdef=document.getElementById("m_"+def);
mdef.className="m_li_a";
}
//子菜单
var ss=document.getElementById("s_"+object);
ss.style.display="none";
//初始子菜单
if(def!=0){
var sdef=document.getElementById("s_"+def);
sdef.style.display="block";
}
}
显示和隐藏层的js