0
点赞
收藏
分享

微信扫一扫

点击鼠标弹出层


<!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>Untitled Document</title>
<script type="text/javascript">
function $(ID)
{return document.getElementById(ID);}

function saet(o)
{
var x=y=0;
do{
x+=o.offsetLeft;
y+=o.offsetTop;
}
while (o=o.offsetParent);
return {"x":x,"y":y};
}

function openwindow(thisObj,openAId,openBId,imgupId,num)
{

var x=saet(thisObj).x;
var y=saet(thisObj).y;
var height = thisObj.offsetHeight;
var newy = y + height;
var newx = x + num;
if($(openAId).style.display=="none")
{
$(openAId).style.display="";
$(openAId).style.top=newy+"px";
$(openAId).style.left=newx+"px";
$(openBId).style.display="";
$(imgupId).src="​​​http://www.baidu.com/img/logo-yy.gif​​​"
}
else
{
$(openAId).style.display="none";
$(openBId).style.display="none";
$(imgupId).src="​​​http://www.google.cn/intl/zh-CN/images/logo_cn.gif​​​"
}
document.body.οnclick=function ()
{
$("openA").style.display="none";
$("openB").style.display="none";

}
}

function close1(closeAId,closeBId)
{

$(closeAId).style.display="none";
$(closeBId).style.display="none";

/*if($(closeAId).style.display=="")
{
$(closeAId).style.display="none";
$(closeBId).style.display="none";
$(imgupId).src="​​​http://www.baidu.com/img/logo-yy.gif​​​"
}
else
{
$(closeAId).style.display="none";
$(closeBId).style.display="none";
$(imgupId).src="​​​http://www.google.cn/intl/zh-CN/images/logo_cn.gif​​​"
}*/
}

</script>

</head>

<body>

<div id="linkopen" style=" cursor:pointer; font-weight:bold; margin-left:200px; width:200px; background:#CCCC33; line-height:100px; color:#FF0000" οnmοuseοver="openwindow(this,'openA','openB','imgup',0)" >点击显示层</div>

<div id="linkopen" style=" cursor:pointer; font-weight:bold; margin-left:200px; width:200px; background:#CCC33C; line-height:100px; color:#FF0000" οnclick="openwindow(this,'openA','openB','imgup',200)">点击显示层</div>

<div id="linkopen" style=" cursor:pointer; font-weight:bold; margin-left:200px; width:200px; background:#C33CCC; line-height:100px; color:#FF0000" οnclick="openwindow(this,'openA','openB','imgup',200)">点击显示层</div>

<div id="openA" style="display:none; height:200px; width:600px; left:0px; top:0px; position:absolute; z-index:3; background:#00f" οnmοuseοut="close1('openA','openB')"></div>
<div id="openB" style="display:none; height:200px; width:600px; background:#0f0"></div>
<img id="imgup" src="​​​http://www.google.cn/intl/zh-CN/images/logo_cn.gif​​​" />
</body>
</html>

举报

相关推荐

0 条评论