<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>標(biāo)題頁(yè)</title>
</head>
<body>
<style>
/* 先把這個(gè) myMenu 的樣式放到css里 */
.myMenu td{font-size:12px;font-family:verdana,arial;font-weight:bolder;color:#ffffff;border:1px solid #336699;background:#336699;filter:blendtrans(duration=0.5);cursor:hand;text-align:center;}
</style>
<script>
//把事件動(dòng)作綁定到菜單上
function addMenu(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='#FEBD20'; //鼠標(biāo)移上去時(shí)的背景顏色
style.border='1px solid #ffffff'; //邊框
style.color='black'; //文字顏色
filters[0].play();
}
}
onmouseout=function(){
with(this){
filters[0].apply();
style.background='#336699'; //鼠標(biāo)離開時(shí)的背景顏色
style.border='1px solid #336699'; //邊框
style.color='#ffffff'; //文字顏色
filters[0].play();
}
}
}
}
}
</script>
<!--菜單從這里開始, 注意要把class設(shè)置成和css里相同的, 還要設(shè)一個(gè)id-->
<table class="myMenu" id="menuTbl" width="500" cellpadding="1" cellspacing="4" border="0" bgcolor="#00000" align="center">
<tr>
<td>網(wǎng)站介紹</td>
<td>開發(fā)文檔</td>
<td>下載軟件</td>
<td>開源管理</td>
<td>網(wǎng)站服務(wù)</td>
</tr>
</table>
<script>addMenu(menuTbl); //在上面這個(gè)table結(jié)束的地方執(zhí)行事件動(dòng)作的綁定, 這里的這個(gè)menuTbl就是那個(gè)table的id</script></body>
</html>