Ejemplo:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transicional//ES">
<html>
<cabeza>
<TITLE>Ventana emergente对象实现右键菜单</TITLE>
<lenguaje de escritura="JavaScript">
var oPopup = ventana.createPopup();
función menú contextual()
{
var izquierda = evento.offsetX+10;
var superior = evento.offsetY+10;
oPopup.document.body.innerHTML = oContext.innerHTML;
oPopup.show(izquierda, arriba, 120, 80, ventana.document.body);
}
</script>
</cabeza>
<cuerpo oncontextmenu="contextMenu(); devolver falso;">
<h1>Popup 对象实现右键菜单</h1>
单击鼠标右键查看效果
<div ID="oContext" style="PANTALLA: ninguna; FONDO: #e4e4e4; ">
<div onmouseover="this.style.background='oro'"
onmouseout="this.style.background='#e4e4e4'"
<span onclick='parent.location.href=" http://www.zol.com.cn"' >
中关村在线</span>
</div>
<div onmouseover="this.style.background='oro'"
onmouseout="this.style.background='#e4e4e4'"
<span onclick="parent.location.href='http://www.cfan.com.cn'">
电脑爱好者</span>
</div>
<div onmouseover="this.style.background='oro';"
onmouseout="this.style.background='#e4e4e4';">
<span onclick="parent.location.href='http://www.sina.com.cn'">
新浪网</span>
</div>
<div onmouseover="this.style.background='oro'"
onmouseout="this.style.background='#e4e4e4'"
<span onclick="parent.location.href='http://www.xinhuanet.com'">
新华网</span>
</div>
</div>
</cuerpo>
</html>