<html>
<head>
<title>网页特效|pqshow.com/Js|--- 炫彩变色菜单(二)</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
<body><style>
.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>
/*
http://lexrus.blueidea.com这是把事件动作绑定到菜单上的函数
*/
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'; //这是鼠标移上去时的背景颜色
style.border='1px solid #ffffff'; //边框
style.color='black'; //文字颜色
filters[0].play();
}
}
onmouseout=function(){
with(this){
filters[0].apply();
style.background='#336699'; //这是鼠标离开时的背景颜色
style.border='1px solid #336699'; //边框
style.color='#ffffff'; //文字颜色
filters[0].play();
}
}
}
}
}
</script><!--菜单从这里开始, 注意要把class设置成和css里相同的, 还要为它设一个id-->
<table class="xmenu" id="xmenu0" width="500" cellpadding="1" cellspacing="4" border="0" bgcolor="#336699" align="center">
<tr>
<td>百度</td>
<td>体育</td>
<td>娱乐</td>
<td>教育</td>
<td>文学</td>
<td>视频</td>
</tr>
</table><script>attachXMenu(xmenu0); //在上面这个table结束的地方执行事件动作的绑定, 这里的这个xmenu0就是那个table的id</script><script>attachXMenu(xmenu1);</script>
</body>
</html>
怎么在里面添加超链接,当点击“百度”时弹出百度网页
<head>
<title>网页特效|pqshow.com/Js|--- 炫彩变色菜单(二)</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
<body><style>
.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>
/*
http://lexrus.blueidea.com这是把事件动作绑定到菜单上的函数
*/
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'; //这是鼠标移上去时的背景颜色
style.border='1px solid #ffffff'; //边框
style.color='black'; //文字颜色
filters[0].play();
}
}
onmouseout=function(){
with(this){
filters[0].apply();
style.background='#336699'; //这是鼠标离开时的背景颜色
style.border='1px solid #336699'; //边框
style.color='#ffffff'; //文字颜色
filters[0].play();
}
}
}
}
}
</script><!--菜单从这里开始, 注意要把class设置成和css里相同的, 还要为它设一个id-->
<table class="xmenu" id="xmenu0" width="500" cellpadding="1" cellspacing="4" border="0" bgcolor="#336699" align="center">
<tr>
<td>百度</td>
<td>体育</td>
<td>娱乐</td>
<td>教育</td>
<td>文学</td>
<td>视频</td>
</tr>
</table><script>attachXMenu(xmenu0); //在上面这个table结束的地方执行事件动作的绑定, 这里的这个xmenu0就是那个table的id</script><script>attachXMenu(xmenu1);</script>
</body>
</html>
怎么在里面添加超链接,当点击“百度”时弹出百度网页
解决方案 »
- 分享个新思路 —— Web跨域、跨页面、跨进程通信
- window.createPopup().show方法
- 腾讯图片站改版了,新版本是如何实现的?
- javascript继承的问题
- 全部分问个问题.关于样式里面的事件
- ●想在text文本框中把","换成"|"?但onChange没效果?
- 请教用javascript写的时间控件
- 如何在網站裏運行本地軟件?
- 在JavaScript中调用new ActiveXObject("Scripting.FileSystemObject")会涉及安全问题吗?
- 求助,关于html2canvas.js,将DIV内容写入Canvas生成图片
- Javascript小程序求助
- 关于下拉列表框的问题
这样适合初学者