///pc/img/blank.gif" width="12" height="8">当前位置:///default.htm" class="under">亿度网络 -> ///pc/index.htm" class="under">网页制作教程 -> JavaScript实例
///pc/homepage/javascript/sample/img/bule.gif" width="207" height="13"> ///pc/homepage/javascript/sample/img/blank.gif" width="1" height="1"> ///pc/homepage/javascript/sample/img/js.gif" width="186" height="20"> ///pc/homepage/javascript/sample/img/blank.gif" width="1" height="1">
///pc/homepage/javascript/sample/img/blank.gif" width="1" height="1"> ///pc/homepage/javascript/sample/img/blank.gif" width="1" height="1">
     变颜色的菜单 ///pc/homepage/javascript/sample/img/blank.gif" width="1" height="1"> ///pc/homepage/javascript/sample/img/blank.gif" width="1" height="1">
    ///pc/homepage/javascript/sample/img/bule1.gif" width="28" height="49">  
效 果 演 示 ///pc/homepage/javascript/sample/img/bule2.gif" width="11" height="18">
              
//www.shanghaigongsi.com.cn/pc/index.htm">网页制作教程
//www.shanghaigongsi.com.cn/eng/index.htm" >轻松英语
//www.shanghaigongsi.com.cn/proedu/index.htm" >继续教育
//www.shanghaigongsi.com.cn/album/index.htm">同窗名录
//www.shanghaigongsi.com.cn/edu/index.htm">动感校园
  
   
 
源代码如下 ///pc/homepage/javascript/sample/img/bule2.gif" width="11" height="18">



这段程序放在<body>与</body>之间


   
源程序讲解: ///pc/homepage/javascript/sample/img/bule2.gif" width="11" height="18">
  ///pc/homepage/javascript/sample/img/bule1.gif" width="28" height="49">  

function openme(object)
{ object.style.background="#FFFFCC";}
function closeme(object)
{ object.style.background="#99FFFF";}
</script>
定义两个函数。功能是定义当前对象的背景色。
<table border="1" cellspacing="2" width="30%" bgcolor="#99FFFF" cellpadding="2" class=p2>
以下都是定义页面菜单的内容。
<tr> <td align="center" width="15%" onMouseOver="openme(this);"
onMouseOut="closeme(this);">

当鼠标移到链接上时,执行openme()函数,即背景色变为#FFFFCC色,当鼠标离开链接时,执行closeme()函数,即背景色变为#99FFFF色。
<a href="http://www.shanghaigongsi.com.cn/pc/
index.htm">
<strong>网页制作教程</strong></a></td>
菜单上的链接。


  ///pc/homepage/javascript/sample/img/blank.gif" width="1" height="1">