用Popup对象构建网页右键菜单
2006-08-09 15:34
411 查看
单击这里下载这段视频。
代码如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<TITLE>Popup对象实现右键菜单</TITLE>
<script language="JavaScript">
var oPopup = window.createPopup();
function contextMenu()
{
var left = event.offsetX+10;
var top = event.offsetY+10;
oPopup.document.body.innerHTML = oContext.innerHTML;
oPopup.show(left, top, 120, 80, window.document.body);
}
</script>
</head>
<body oncontextmenu="contextMenu(); return false;">
<h1>Popup对象实现右键菜单</h1>
单击鼠标右键查看效果
<div ID="oContext" style="DISPLAY: none; BACKGROUND: #e4e4e4; ">
<div onmouseover="this.style.background='gold'"
onmouseout="this.style.background='#e4e4e4'"
<span onclick='parent.location.href="http://www.zol.com.cn"'>
中关村在线</span>
</div>
<div onmouseover="this.style.background='gold'"
onmouseout="this.style.background='#e4e4e4'"
<span onclick="parent.location.href='http://www.cfan.com.cn'">
电脑爱好者</span>
</div>
<div onmouseover="this.style.background='gold';"
onmouseout="this.style.background='#e4e4e4';">
<span onclick="parent.location.href='http://www.sina.com.cn'">
新浪网</span>
</div>
<div onmouseover="this.style.background='gold'"
onmouseout="this.style.background='#e4e4e4'"
<span onclick="parent.location.href='http://www.xinhuanet.com'">
新华网</span>
</div>
</div>
</body>
</html>
http://www.cnblogs.com/tyrael007/archive/2006/08/05/468821.html
代码如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<TITLE>Popup对象实现右键菜单</TITLE>
<script language="JavaScript">
var oPopup = window.createPopup();
function contextMenu()
{
var left = event.offsetX+10;
var top = event.offsetY+10;
oPopup.document.body.innerHTML = oContext.innerHTML;
oPopup.show(left, top, 120, 80, window.document.body);
}
</script>
</head>
<body oncontextmenu="contextMenu(); return false;">
<h1>Popup对象实现右键菜单</h1>
单击鼠标右键查看效果
<div ID="oContext" style="DISPLAY: none; BACKGROUND: #e4e4e4; ">
<div onmouseover="this.style.background='gold'"
onmouseout="this.style.background='#e4e4e4'"
<span onclick='parent.location.href="http://www.zol.com.cn"'>
中关村在线</span>
</div>
<div onmouseover="this.style.background='gold'"
onmouseout="this.style.background='#e4e4e4'"
<span onclick="parent.location.href='http://www.cfan.com.cn'">
电脑爱好者</span>
</div>
<div onmouseover="this.style.background='gold';"
onmouseout="this.style.background='#e4e4e4';">
<span onclick="parent.location.href='http://www.sina.com.cn'">
新浪网</span>
</div>
<div onmouseover="this.style.background='gold'"
onmouseout="this.style.background='#e4e4e4'"
<span onclick="parent.location.href='http://www.xinhuanet.com'">
新华网</span>
</div>
</div>
</body>
</html>
http://www.cnblogs.com/tyrael007/archive/2006/08/05/468821.html
相关文章推荐
- 用Popup对象构建网页右键菜单
- js - 用Popup对象构建网页右键菜单
- 用Popup对象构建自定义的网页右键菜单
- Popup对象实现右键菜单
- Popup对象实现右键菜单
- 自定义网页右键菜单
- 超实用一键破解网页不能复制/右键菜单限制的 Bookmarklet 收藏夹书签小工具
- paip.网页右键复制菜单限制解除解决方案
- dtree 网页树状菜单及传递对象集合到js内,动态生成节点
- 禁止网页内容复制、选取、禁止右键菜单js代码
- 网页右键菜单开发
- 网页右键菜单
- 网页右键菜单
- JS实现仿Windows7风格的网页右键菜单效果代码
- JS实现简易网页右键菜单
- 网页设计精华点滴,如屏蔽【复制、选择、右键菜单】等
- paip.网页右键复制菜单限制解除解决方案
- 禁止另存网页、屏蔽选中、粘贴、复制、剪切、右键菜单程序代码
- 右键菜单 添加新的 文件对象关联菜单
- jquery实现在网页指定区域显示自定义右键菜单效果