菜单JS

2009-06-24 21:52:53 作者:adminniu 来源: 浏览次数:0 网友评论 0

function turnmenu(obj,len) {

function turnmenu(obj,len) {

 var arr = zilei.getElementsByTagName("div");//查找id为zilei中的div
 for(var i=0;i<arr.length;i++)
 {
  var tmp = arr[i];
  if(tmp.id.indexOf("menu123next|")!=-1)//子类id名中含有menu123next|的div
  {
   tmp.style.display = "none";
  }
 }
 var arrimg = top_nav_wid.getElementsByTagName("img");
 for(var i=0;i<arrimg.length;i++)
 {
  var tmpimg = arrimg[i];
  if(tmpimg.id.indexOf("menu123|")!=-1)
  {
   arrname=tmpimg.id.split("|");
   tmpimg.src="images/menu/"+arrname[1]+"b.gif";
  }
 }
 menuname=obj.split("|");
 document.getElementById(obj).src="images/menu/"+menuname[1]+"a.gif";
 document.getElementById('menu123next|'+menuname[1]).style.display="";
 document.getElementById('menu123next|'+menuname[1]).style.left=document.getElementById(obj).offsetParent.offsetLeft;//设置div的左坐标等于父类的左坐标
}

关键词:js

[错误报告] [收藏] [打印] [关闭] [返回顶部]

最新图片文章

最新文章