⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 14-5.htm

📁 JScript网页特效,包含很多的实现网页特效的方法.
💻 HTM
字号:
<html>
<head>
<title>§14.5 右键菜单</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#FFFFFF" text="#000000">
请点击右键试试!
<style>
<!--
.skin0 {
position:absolute;
text-align:left;
width:100px;
border:1px solid black;
background-color:#A8D8E8;
font-family:宋体;
font-size: 12px;
line-height:20px;
cursor:default;
visibility:hidden;
}
.skin1 {
cursor:default;
font:menutext;
position:absolute;
text-align:left;
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
width:120px;
background-color:menu;
border:1 solid buttonface;
visibility:hidden;
border:2 outset buttonhighlight;
}
.menuitems {
padding-left:15px;
padding-right:10px;
}
-->
</style>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
var menuskin = "skin0"; //选择菜单的样式: skin0 or skin1
var display_url = 0; // 是否在状态栏显示链接的URL
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 = "highlight";
    event.srcElement.style.color = "white";
    if (display_url)
      window.status = event.srcElement.url;
   }
}

function lowlightie5() 
{
  if (event.srcElement.className == "menuitems") 
  {
    event.srcElement.style.backgroundColor = "";
    event.srcElement.style.color = "black";
    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" class="skin0" onMouseover="highlightie5()" onMouseout="lowlightie5()" onClick="jumptoie5();">
<div class="menuitems" url="http://javascript100.yeah.net">返回首页</div>
<div class="menuitems" url="javascript:history.back();">回上一页</div>
<div class="menuitems" url="http://javascript100.yeah.net">到栏目一</div>
<div class="menuitems" url="http://javascript100.yeah.net">到栏目二</div>
<div class="menuitems" url="http://javascript100.yeah.net">到栏目三</div>
<div class="menuitems" url="mailto:future3@yeah.net">给我来信</div>
</div>
<script language="JavaScript1.2">
if (document.all && window.print) 
{ 
  ie5menu.className = menuskin;
  document.oncontextmenu = showmenuie5;
  document.body.onclick = hidemenuie5;
}
</script>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -