样式代码:
<style type="text/css">rWPLinux联盟
body{font: 9pt "宋体"; margintop: 0px ; color: red; background: #ffffff}rWPLinux联盟
a.{ font: 9pt "宋体"; cursor: hand; font-size: 9pt ; color: blue; text-decoration: none }rWPLinux联盟
a:active{ font: 9pt "宋体"; cursor: hand; color: #FF0033 }rWPLinux联盟
a.cc:hover{ font: 9pt "宋体"; cursor: hand; color: #FF0033}rWPLinux联盟
.box{ font: 9pt "宋体"; position: absolute; background: LightGrey; }rWPLinux联盟
</style>
html代码如下:
<table id="itemopen" class="box" style="DISPLAY:none">rWPLinux联盟
<tr>rWPLinux联盟
<td>弹出菜单</td>rWPLinux联盟
</tr>rWPLinux联盟
<tr>rWPLinux联盟
<td><a href="http://blog.csdn.net/Erickson/" class="cc">Erickson的专栏</a></td>rWPLinux联盟
</tr>rWPLinux联盟
<tr>rWPLinux联盟
<td><a href="http://www.csdn.net" class="cc">CSDN</a></td>rWPLinux联盟
</tr>rWPLinux联盟
<tr>rWPLinux联盟
<td><a href="http://www.google.com" class="cc">Google 搜索</a></td>rWPLinux联盟
</tr>rWPLinux联盟
<tr>rWPLinux联盟
<td><a href="http://www.sohu.com" class="cc">搜狐</a></td>rWPLinux联盟
</tr>rWPLinux联盟
<tr>rWPLinux联盟
<td><a href="http://www.yahoo.com" class="cc">Yahoo</a></td>rWPLinux联盟
</tr>rWPLinux联盟
<tr>rWPLinux联盟
<td><a href="http://www.163.com" class="cc">163 网站</a></td>rWPLinux联盟
</tr>rWPLinux联盟
<tr>rWPLinux联盟
<td><a href="http://sports.sina.com.cn" class="cc">新浪网体育</a></td>rWPLinux联盟
</tr>rWPLinux联盟
</table>
脚本代码:
右击鼠标显示快捷菜单:rWPLinux联盟
<script language="JavaScript">rWPLinux联盟
document.onmousedown = function popUp() {rWPLinux联盟
menu = document.all.itemopenrWPLinux联盟
if (event.button == 2) {rWPLinux联盟
newX = window.event.x + document.body.scrollLeftrWPLinux联盟
newY = window.event.y + document.body.scrollToprWPLinux联盟
menu.style.display = ""rWPLinux联盟
menu.style.pixelLeft = newXrWPLinux联盟
menu.style.pixelTop = newYrWPLinux联盟
}rWPLinux联盟
else if (event.button == 1)rWPLinux联盟
{rWPLinux联盟
menu.style.display = "none"rWPLinux联盟
}rWPLinux联盟
}rWPLinux联盟
</script>
屏蔽IE默认的WinForm快捷菜单:rWPLinux联盟
<script language="JavaScript">rWPLinux联盟
var message="";rWPLinux联盟
function clickIE()rWPLinux联盟
{rWPLinux联盟
if (document.all)rWPLinux联盟
{rWPLinux联盟
(message);rWPLinux联盟
return false;rWPLinux联盟
}rWPLinux联盟
}rWPLinux联盟
function clickNS(e)rWPLinux联盟
{rWPLinux联盟
if (document.layers||(document.getElementById&&!document.all))rWPLinux联盟
{rWPLinux联盟
if (e.which==2)rWPLinux联盟
{rWPLinux联盟
newX = window.event.x + document.body.scrollLeftrWPLinux联盟
newY = window.event.y + document.body.scrollToprWPLinux联盟
menu = document.all.itemopenrWPLinux联盟
if ( menu.style.display == "")rWPLinux联盟
{rWPLinux联盟
menu.style.display = "none"rWPLinux联盟
}rWPLinux联盟
elserWPLinux联盟
{rWPLinux联盟
menu.style.display = ""rWPLinux联盟
}rWPLinux联盟
menu.style.pixelLeft = newXrWPLinux联盟
menu.style.pixelTop = newYrWPLinux联盟
}rWPLinux联盟
if (e.which==3)rWPLinux联盟
{rWPLinux联盟
(message);rWPLinux联盟
return false;rWPLinux联盟
}rWPLinux联盟
}rWPLinux联盟
}rWPLinux联盟
if (document.layers)rWPLinux联盟
{rWPLinux联盟
document.captureEvents(Event.MOUSEDOWN);rWPLinux联盟
document.onmousedown=clickNS;rWPLinux联盟
}rWPLinux联盟
elserWPLinux联盟
{rWPLinux联盟
document.onmouseup=clickNS;document.oncontextmenu=clickIE;rWPLinux联盟
}rWPLinux联盟
document.oncontextmenu=new Function("return false")rWPLinux联盟
</script>
Linux联盟收集整理 ,转贴请标明原始链接,如有任何疑问欢迎来本站Linux论坛讨论