<script>
function showDiv(o)
{
var div=document.getElementById("div");
div.style.display=div.style.display==""?"none":"";
div.style.left=realOffset(o).x+"px";
div.style.top=realOffset(o).y+"px";
}function realOffset(o)
{
  var x = y = 0; do{
  x += o.offsetLeft || 0; 
  y += o.offsetTop  || 0;
  o  = o.offsetParent;}while(o);
  return {"x" : x, "y" : y};
};
</script><br><br><br><br>
<br><br><br><br>
<br><br><br><br>
<br><br><br><br>
xxxxxxxxxxxxx<input type="button" value="show" onclick="showDiv(this)">
<div id="div" style="border:1px solid black;width:200px;height:200px;display:none;position:absolute"></div>这样的?