右键菜单后
<!DOCTYPE HTML>
<html>
<head>
<meta content="text/html; charset=GB2312" http-equiv="Content-Type">
<style>
a {font-size:14px;color: #000;text-decoration: none;}
a:link {font-size:14px;color: #000;text-decoration: none}
a:visited {color: #000;text-decoration: none}
a:hover {color: #ff9900;text-decoration: none}
a:active {color: #ff9900;text-decoration: none }
.mouse_state{font-size:12px;padding-top:1px;padding-left:2px}
.mouse_out{font-size:12px;padding-top:1px;padding-left:2px}
.mouse_on{font-size:12px;padding-top:1px;padding-left:2px;background-color:#E8E8E8;}
</style>
<script type="text/javascript">
function Click() { return false; } document.oncontextmenu = Click;
function imgout() {
document.getElementById("rtmenu").style.display = "none";
}
function submitByEnter(e) {
if (e.button == 0) {
imgout();
}
if (e.button == 2)
{
var obj = document.getElementById("rtmenu");
var ex; var ey;
if (e.pageX != null)
{
ex = e.pageX;
ey = e.pageY;
}
else
{
ex = e.x;
ey = e.y;
}
obj.style.left = ex + 'px';
obj.style.top = ey + 'px';
obj.style.display = "";
}
}
function listen() {
try {
document.addEventListener('mouseup', submitByEnter, true);
}
catch (ex) {
document.attachEvent('onmouseup', submitByEnter);
}
}
</script>
</head><body onmousedown="listen()">
<div id="rtmenu" onclick="imgout()" style="width:60px; padding-top:5px; padding-bottom:5px; text-align:center;cursor:pointer;border:2px solid #CCC; display:none; position:absolute;">
<div class="mouse_state" onmouseover="this.className='mouse_on';" onmouseout="this.className='mouse_out';"><a href="http://www.hahaqi.com/">首页</a></div>
<div class="mouse_state" onmouseover="this.className='mouse_on';" onmouseout="this.className='mouse_out';"><a href="http://www.hahaqi.com/Book/">小说</a></div>
<div class="mouse_state" onmouseover="this.className='mouse_on';" onmouseout="this.className='mouse_out';"><a href="http://www.hahaqi.com/manh/">漫画</a></div>
<div class="mouse_state" onmouseover="this.className='mouse_on';" onmouseout="this.className='mouse_out';"><a href="http://www.hahaqi.com/Talk.aspx">闪吧</a></div>
<div class="mouse_state" onmouseover="this.className='mouse_on';" onmouseout="this.className='mouse_out';"><a href="">退出</a></div>
</div>
</body></html>
<html>
<head>
<meta content="text/html; charset=GB2312" http-equiv="Content-Type">
<style>
a {font-size:14px;color: #000;text-decoration: none;}
a:link {font-size:14px;color: #000;text-decoration: none}
a:visited {color: #000;text-decoration: none}
a:hover {color: #ff9900;text-decoration: none}
a:active {color: #ff9900;text-decoration: none }
.mouse_state{font-size:12px;padding-top:1px;padding-left:2px}
.mouse_out{font-size:12px;padding-top:1px;padding-left:2px}
.mouse_on{font-size:12px;padding-top:1px;padding-left:2px;background-color:#E8E8E8;}
</style>
<script type="text/javascript">
function Click() { return false; } document.oncontextmenu = Click;
function imgout() {
document.getElementById("rtmenu").style.display = "none";
}
function submitByEnter(e) {
if (e.button == 0) {
imgout();
}
if (e.button == 2)
{
var obj = document.getElementById("rtmenu");
var ex; var ey;
if (e.pageX != null)
{
ex = e.pageX;
ey = e.pageY;
}
else
{
ex = e.x;
ey = e.y;
}
obj.style.left = ex + 'px';
obj.style.top = ey + 'px';
obj.style.display = "";
}
}
function listen() {
try {
document.addEventListener('mouseup', submitByEnter, true);
}
catch (ex) {
document.attachEvent('onmouseup', submitByEnter);
}
}
</script>
</head><body onmousedown="listen()">
<div id="rtmenu" onclick="imgout()" style="width:60px; padding-top:5px; padding-bottom:5px; text-align:center;cursor:pointer;border:2px solid #CCC; display:none; position:absolute;">
<div class="mouse_state" onmouseover="this.className='mouse_on';" onmouseout="this.className='mouse_out';"><a href="http://www.hahaqi.com/">首页</a></div>
<div class="mouse_state" onmouseover="this.className='mouse_on';" onmouseout="this.className='mouse_out';"><a href="http://www.hahaqi.com/Book/">小说</a></div>
<div class="mouse_state" onmouseover="this.className='mouse_on';" onmouseout="this.className='mouse_out';"><a href="http://www.hahaqi.com/manh/">漫画</a></div>
<div class="mouse_state" onmouseover="this.className='mouse_on';" onmouseout="this.className='mouse_out';"><a href="http://www.hahaqi.com/Talk.aspx">闪吧</a></div>
<div class="mouse_state" onmouseover="this.className='mouse_on';" onmouseout="this.className='mouse_out';"><a href="">退出</a></div>
</div>
</body></html>
浙公网安备 33010602011771号