<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>導(dǎo)航菜單特效</title>
<style>
/* 先把這個(gè) xmenu 的樣式放到css里 */
.xmenu 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)作綁定到菜單上的函數(shù)
*/
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='#66CCFF'; //這是鼠標(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>
</head>
<BODY>
<table class="xmenu" id="xmenu0" width="500" cellpadding="1" cellspacing="4" border="0" bgcolor="#336699" align="center">
<tr>
<td onclick="location.>網(wǎng)頁特效ASPJZ.COM</td>
<td onclick="location.>Butong.net</td>
<td>Is</td>
<td>LeX</td>
<td>Rus</td>
<td>!!!</td>
</tr>
</table>
<script>attachXMenu(xmenu0); //在上面這個(gè)table結(jié)束的地方執(zhí)行事件動(dòng)作的綁定, 這里的這個(gè)xmenu0就是那個(gè)table的id</script>
<br><br><br><br>
<!--下面這個(gè)是豎排的-->
<table class="xmenu" id="xmenu1" width="100" cellpadding="1" cellspacing="4" border="0" bgcolor="#336699" align="center">
<tr><td>My</td></tr>
<tr><td>Name</td></tr>
<tr><td>Is</td></tr>
<tr><td>LeX</td></tr>
<tr><td>Rus</td></tr>
<tr><td>!!!</td></tr>
</table>
<script>attachXMenu(xmenu1);</script>
</body>
</html>