web| Menu | page |-Right
Style code:
<style type= "Text/css" >
Body{font:9pt "Song body"; margintop:0px; color:red background: #ffffff}
a.{font:9pt "song body"; cursor:hand; font-size:9pt; color:blue; Text-decoration:none}
a:active{font:9pt "song body"; Cursor:hand color: #FF0033}
a.cc:hover{font:9pt "song body"; Cursor:hand color: #FF0033}
. box{font:9pt "song Body"; Position:absolute Background:lightgrey;}
</style>
The HTML code is as follows:
<table id= "Itemopen" class= "box" style= "Display:none" >
<tr>
<td> pop-up menu </td>
</tr>
<tr>
<td><a href= "http://blog.csdn.net/Erickson/"class=" CC ">erickson's column </a></td>
</tr>
<tr>
<td><a href= "http://www.csdn.net"class=" CC >CSDN</a></td>
</tr>
<tr>
<td><a href= "http://www.google.com"class= cc" >google search </a></td>
</tr>
<tr>
<td><a href= "http://www.sohu.com"class=" CC > Sohu </a></td>
</tr>
<tr>
<td><a href= "http://www.yahoo.com"class=" CC >Yahoo</a></td>
</tr>
<tr>
<td><a href= "http://www.163.com"class= cc" >163 website </a></td>
</tr>
<tr>
<td><a href= "http://sports.sina.com.cn"class=" CC > Sina sports </a></td>
</tr>
</table>
Scripting code:
Right-click the mouse to display the shortcut menu:
<script language= "JavaScript" >
Document.onmousedown = function popUp () {
menu = Document.all.itemopen
if (Event.button = = 2) {
NEWX = Window.event.x + document.body.scrollLeft
Newy = Window.event.y + document.body.scrollTop
Menu.style.display = ""
Menu.style.pixelLeft = newx
Menu.style.pixelTop = Newy
}
else if (Event.button = 1)
{
Menu.style.display = "None"
}
}
</script>
screen IE default WinForm shortcut menu:
<script language= "JavaScript" >
var message= "";
function Clickie ()
{
if (document.all)
{
(message);
return false;
}
}
function Clickns (e)
{
if (document.layers| | (Document.getelementbyid&&!document.all))
{
if (e.which==2)
{
NEWX = Window.event.x + document.body.scrollLeft
Newy = Window.event.y + document.body.scrollTop
menu = Document.all.itemopen
if (Menu.style.display = "")
{
Menu.style.display = "None"
}
Else
{
Menu.style.display = ""
}
Menu.style.pixelLeft = newx
Menu.style.pixelTop = Newy
}
if (e.which==3)
{
(message);
return false;
}
}
}
if (document.layers)
{
Document.captureevents (Event.mousedown);
DOCUMENT.ONMOUSEDOWN=CLICKNS;
}
Else
{
Document.onmouseup=clickns;document.oncontextmenu=clickie;
}
Document.oncontextmenu=new Function ("return false")
</script>