为什么我做的点击右键菜单,显示的时候DIV没有样式,代码如下:
<HTML>
<HEAD>
<TITLE>Popup对象实现右键菜单</TITLE>
<style> DIV.skin0 { BORDER-RIGHT: black 2px solid; BORDER-TOP: black 2px solid; VISIBILITY: hidden; BORDER-LEFT: black 2px solid; WIDTH: 200px; CURSOR: default; LINE-HEIGHT: 20px; BORDER-BOTTOM: black 2px solid; FONT-FAMILY: Verdana; POSITION: absolute; BACKGROUND-COLOR: menu; TEXT-ALIGN: left }
DIV.menuitems { PADDING-RIGHT: 10px; PADDING-LEFT: 15px }
</style>
<script language="JavaScript">
var oPopup = window.createPopup();
function contextMenu()
{var left = event.offsetX;
var top = event.offsetY;oPopup.document.body.innerHTML = oContext.innerHTML; 
oPopup.show(left, top, 120, 150, window.document.body);}
</script>
</HEAD>
<body oncontextmenu="contextMenu(); return false;">
<div ID="oContext" style="DISPLAY: none; BACKGROUND: #d4d0c8" class="skin0">
<div onmouseover="this.style.background='0a642a'" onmouseout="this.style.background='#d4d0c8'"
class="menuitems">
<span onclick='parent.location.href="http://www.zol.com.cn"'>
中关村在线</span>
</div>
<div onmouseover="this.style.background='0a642a'" onmouseout="this.style.background='#d4d0c8'"
class="menuitems">
<span onclick="parent.location.href='http://www.cfan.com.cn'">
电脑爱好者</span>
</div>
<div onmouseover="this.style.background='0a642a';" onmouseout="this.style.background='#d4d0c8';"
class="menuitems">
<span onclick="parent.location.href='http://www.sina.com.cn'">
新浪网</span>
</div>
<div onmouseover="this.style.background='0a642a'" onmouseout="this.style.background='#d4d0c8'"
class="menuitems">
<span onclick="parent.location.href='http://www.xinhuanet.com'">
新华网</span>
</div>
<div onmouseover="this.style.background='0a642a'" onmouseout="this.style.background='#d4d0c8'"
class="menuitems">
<span onclick="parent.location.href='http://www.xinhuanet.com'">
新华网</span>
</div>
</div>
</body>
</HTML>