当前位置:编程学习 > JS >>

js控制菜单换背景

js控制菜单换背景

function attachXMenu(objid){
 var tds=objid.getElementsByTagName('td');
 for(var i=0;i<tds.length;i++){
  with(tds[i]){
   onmouseover=function(){
    with(this){
     filters[0].apply();
     style.background='url("images/over.gif")';
     style.color='#ffffff'; //文字颜色
     filters[0].play();
    }
   }
   onmouseout=function(){
    with(this){
     filters[0].apply();
     style.background='';
     style.color='#fedbbf'; //文字颜色
     filters[0].play();
    }
   }
  }
 }
}

补充:网页制作,js教程 
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,