<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
#topdiv{ position:absolute; width:400px; height:150px;top:20%;left:50%; border:1px solid #3568B5; margin-left:-200px; display:none; z-index:100; padding:2px; background-color:#FFFFFF}
#topdiv h3{ position:relative;margin-top:25px; font-size:15px; padding-left:10px; background-color:#3568B5;line-height:25px;}
#topdiv h3 a{ position:absolute;color:#FFFFFF;text-decoration : none;right:5px;}
#topdiv div{ font-size:20px; padding-left:40px; padding-top:10px;}
#bigDiv{ display:none;z-index:99; background-color:#e3e3e3; position:absolute; left:0; top:0; width:100%; height:100%; orphans:0.3;filter: alpha(opacity=50);-moz-opacity:0.5}
</style>
<script language="javascript">
function funDiv(a){
var tdiv = document.getElementByIdx_x("topdiv");
var bdiv = document.getElementByIdx_x("bigDiv")
if(a==1){
tdiv.style.display="block";
bdiv.style.display="block";
}else{
tdiv.style.display="none";
bdiv.style.display="none";
}
}
</script>
</head>
<body οncοntextmenu="return false" onselectstart="return false" οndragstart="return false">
<div id="bigDiv"></div>
<div id="topdiv">
<h3>弹出的div<a href="#" οnclick="funDiv(0);">关闭</a></h3>
<div>阔你几挖!!!</div>
</div>
<input type="button" value="点我弹Div" οnclick="funDiv(1);">
</body>
</html>
oncontextmenu
在用户使用鼠标右键单击客户区打开上下文菜单时触发。
onselectstart
对象将要被选中时触发。
ondragstart 当用户开始拖曳文本选中区或选中对象时在源对象上触发。