资料
表格
制度
合同
管理
职场
经营
创业
范文
总结
计划
作文
文章
美文
词句
教程
模板
图片
字体
图标
办公
人事
财务
生产
管理资源吧首页
>>>
教程
>>>
编程
>>>
JavaScript教程
>>>
Popup对象实现右键菜单
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <TITLE>Popup对象实现右键菜单</TITLE> <img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3Cscript%20language%3D%22JavaScript%22%3E%20%0D%0A%20var%20oPopup%20%3D%20window.createPopup()%3B%20%0D%0A%20function%20contextMenu()%20%0D%0A%20%7B%20%0D%0A%20%20%20%20%20var%20left%20%3D%20event.offsetX%2B10%3B%20%0D%0A%20%20%20%20%20var%20top%20%3D%20event.offsetY%2B10%3B%20%0D%0A%20%20%20%20%20oPopup.document.body.innerHTML%20%3D%20oContext.innerHTML%3B%20%0D%0A%20%20%20%20%20oPopup.show(left%2C%20top%2C%20120%2C%2080%2C%20window.document.body)%3B%20%0D%0A%20%20%20%20%20%7D%20%0D%0A%20%3C%2Fscript%3E"> </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>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行
]
教程首页
更多教程