做了一个类似的<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Keywords" content="51windows.Net">
<META NAME="Author" CONTENT="haiwa">
<title>New Document -51windows.Net</title>
<style>
<!--
*         {font:menu}
-->
</style>
</head><body>
<div id="mydiv" style="position: absolute; top: 0; left: 0; width:0; height: 0; background-color: #F7F7F7; border: 1 solid #999999;display:none;" onclick=alert(document.all.mydiv.style.width)></div>
<SCRIPT LANGUAGE="JavaScript">
<!--
var thetimer
function hw(e)
{
var t=e.offsetTop; 
var l=e.offsetLeft; 
var w=e.offsetWidth;
var h=e.offsetHeight;
while(e=e.offsetParent)

t+=e.offsetTop; 
l+=e.offsetLeft; 
}
document.all.mydiv.style.display= "";
document.all.mydiv.style.top = t;
document.all.mydiv.style.left = l;
document.all.mydiv.style.width = 480;
document.all.mydiv.style.height = 240;
thetimer = setInterval("hw2()",10)
}
function hw2()
{
if (parseInt(document.all.mydiv.style.width)>0)
{
document.all.mydiv.style.width = parseInt(document.all.mydiv.style.width)-40
document.all.mydiv.style.height = parseInt(document.all.mydiv.style.height)-20
}
else
{
clearInterval(thetimer);
document.all.mydiv.style.display = "none";
document.all.haiwaOK.disabled = true;
}
}
//-->
</SCRIPT>
<button onclick='hw(document.all.haiwaOK);' name="haiwaOK">添加</button> <br><br><br><br> <button onclick='document.all.haiwaOK.disabled = false;' name="">again</button>
</body></html>