设计师吧首页
 用户名  密码 记住
首页文章展厅讨论自语纸条好友档案
一个流传了很久的右键菜单代码
作者:diyer   日期:2007-10-31   来源:原创
<style>
 
div{
display:inline;
float:left;
color:#333}
.skin0 { 
position:absolute; 
text-align:left; 
width:274px; 
border:1px solid #333; 
background-color:transparent; 
font-family:Verdana; 
font-size:9pt;
line-height:15px; 
cursor:default; 
visibility:hidden; 
} 
.skin1 { 
cursor:default; 
font:menutext; 
position:absolute; 
text-align:left; 
font-family: Arial, Helvetica, sans-serif; 
font-size:9pt; 
width:140px; 
background-color:#ccc; 
visibility:hidden; 
border:2 outset buttonhighlight; 
} 
.menuitems {padding:5px} 
 

</style>
<body ondragstart="window.event.returnValue=false" onselectstart="event.returnValue=false">
<script language="JavaScript1.2">
<!-- Begin 
var menuskin = "skin0"; // skin0, or skin1 
var display_url = 0; // Show URLs in status bar? 
function showmenuie5() { 
var rightedge = document.body.clientWidth-event.clientX; 
var bottomedge = document.body.clientHeight-event.clientY; 
if (rightedge < ie5menu.offsetWidth) 
ie5menu.style.left = document.body.scrollLeft + event.clientX - ie5menu.offsetWidth; 
else 
ie5menu.style.left = document.body.scrollLeft + event.clientX; 
if (bottomedge < ie5menu.offsetHeight) 
ie5menu.style.top = document.body.scrollTop + event.clientY - ie5menu.offsetHeight; 
else 
ie5menu.style.top = document.body.scrollTop + event.clientY; 
ie5menu.style.visibility = "visible"; 
return false; 
} 

function hidemenuie5() { 
ie5menu.style.visibility = "hidden"; 
} 
function highlightie5() { 
if (event.srcElement.className == "menuitems") { 
event.srcElement.style.backgroundColor = "#999"; 
event.srcElement.style.color = "#fff"; 
if (display_url) 
window.status = event.srcElement.url; 
} 
} 

function lowlightie5() { 
if (event.srcElement.className == "menuitems") { 
event.srcElement.style.backgroundColor = ""; 
event.srcElement.style.color = "#333"; 
window.status = ""; 
} 
} 

function jumptoie5() { 
if (event.srcElement.className == "menuitems") { 
if (event.srcElement.getAttribute("target") != null) 
window.open(event.srcElement.url, event.srcElement.getAttribute("target")); 
else 
window.location = event.srcElement.url; 
} 
} 
// End -->
</script>
<div id="ie5menu" onmouseover="highlightie5()" onmouseout="lowlightie5()" onclick="jumptoie5();">
    <div class="menuitems" url="#">
         首页</div>
    <div class="menuitems" url="#">
         日志</div>
    <div class="menuitems" url="#">
         相册</div>
    <div class="menuitems" url="#">
         留言</div>
    <div class="menuitems" url="#">
         收藏</div>
    <div class="menuitems" onclick="javascript:window.location.reload()">
         刷新</div>
    <div class="menuitems" url="#">
         音乐</div>
    <div class="menuitems" url="#">
         灰度</div>
</div>
<script language="JavaScript1.2">
if (document.all && window.print) { 
ie5menu.className = menuskin; 
document.oncontextmenu = showmenuie5; 
document.body.onclick = hidemenuie5; 
}
</script>
请单击右键
</body>
查看次数: 105
最近看过此内容的会员

冰河
您可能对这些内容感兴趣
·object-目标软件有限公司·十种习惯让人寿命减少十年
·公司前台喷绘照片·缤纷创意全在我--Wacom推出贵凡系列数位板
·2007中国互联网哈哈榜之四大牛人·I am jack!单灯人像摄影练习海报恶搞
·iQue-神游科技有限公司·阳光MM018
·易趣创始人邵亦波 轻松融资诀窍·阳光MM012
评论列表
没有评论
■游客, 您可以在此发表您的评论
使用这个表情使用这个表情使用这个表情使用这个表情使用这个表情
使用这个表情使用这个表情使用这个表情使用这个表情使用这个表情
使用这个表情使用这个表情使用这个表情使用这个表情使用这个表情
使用这个表情使用这个表情使用这个表情使用这个表情使用这个表情
使用这个表情使用这个表情使用这个表情使用这个表情使用这个表情
使用这个表情使用这个表情使用这个表情使用这个表情使用这个表情
使用这个表情使用这个表情使用这个表情使用这个表情使用这个表情
请您注意
·遵守《互联网电子公告服务管理规定》
·遵守《全国人大常委会关于维护互联网安全的决定》
·遵守中华人民共和国的各项有关法律法规
·承担一切因您的言论而直接或间接导致的法律责任
·参与本留言即表明您已经阅读并接受上述条款
Copyright © 2007-2008 Sjs8.com 中国数字设计师网
你好大海 模版由neewoo.com提供