十万火急:这两个层应该如何设置可拖动和可关闭?

来源:百度知道 编辑:UC知道 时间:2024/06/11 15:13:39
如果有答案,必定今晚结贴的问题:

下面有两个层,我希望让它们实现可拖动,并且,关闭层A则打开层B,反之亦然。
小弟对JS和CSS都不怎么熟悉,希望高手写出代码,感激不尽。

<style>
<!--
.div{
position: absolute;
border: 42px solid yellow;
line-height:22px;
font-size:22px;
z-index:777;
}
-->
</style>
<div id="Javascript.menu2" class="div" style="width: 39px; height:22px;" align="right">层A</div>
<div id="Javascript.menu1" class="div" style="width: 39px; height:22px;visibility:hidden;" align="right">层B</div>
<SCRIPT LANGUAGE="JavaScript">
function sc1(){
document.getElementById("Javascript.menu1").style.top=document.body.scrollTop+document.body.clientHeight-document.getElementById("Javascript.menu1").offsetHeight;
document.getElementById("Javascript.menu1").style.left=document.body.scrollLeft+document.bo

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>div</title>
</head>

<body>
<script type="text/javascript">
function display()
{
document.write("<div id='ProgressBar' style='font-size:12px; width=300 position:absolute;display:none;text-align:center;overflow:visible'>");
document.write("<div style='position:absolute;top:expression((body.clientHeight-50)/2);left:expression((body.clientWidth-200)/2);width:200px;height:20px;'>");
document.write("<table bgcolor='#000000' class='tborder' border='0' cellspacing='2' cellpadding='0' width=300 height=100 onmousedown='ProgressBar_x=event.x-parentNode.style.pixelLeft;ProgressBar_y=event.y-parentNode.style.pixelTop;setCapture();&