是不是这个东西
<html>
<head>
<style>
<!--.drag{position:relative;cursor:hand}
-->
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<script language="JavaScript">
var dragapproved=false
var z,x,y
function move(){
if (event.button==1&&dragapproved){
z.style.pixelLeft=temp1+event.clientX-x
z.style.pixelTop=temp2+event.clientY-y
return false
}}
function drags(){
if (!document.all)
return
if (event.srcElement.className=="drag"){
dragapproved=true
z=event.srcElement
temp1=z.style.pixelLeft
temp2=z.style.pixelTop 
x=event.clientX
y=event.clientY
document.onmousemove=move
}}
document.onmousedown=drags
document.onmouseup=new Function("dragapproved=false")
</script>
   <div class="drag" style="position:absolute; width:445px; z-index:1;left:182px; top: 198px; height: 311px; display:block;background-color:#003333;"><a href="####" onclick="document.all('strdiv').style.display='none';">关闭</a><a></div></body>
</html>

解决方案 »

  1.   

    是不是要这样的:
    <HTML>
    <HEAD>
    <TITLE> move </TITLE>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    var mouseStatus,startx,starty,elmTop,elmLeft;
    function startMove(){
    mouseStatus = "down";
    startx = parseInt(event.x);
    starty = parseInt(event.y);
    elmTop = parseInt(strdiv.style.top);
    elmLeft = parseInt(strdiv.style.left);
    }
    function stopMove(){
    mouseStatus = "up";
    }
    function doMove(){
    if (mouseStatus == "down"){
    strdiv.style.top = elmTop+parseInt(event.y)-starty;
    strdiv.style.left = elmLeft+parseInt(event.x)-startx;
    }
    }
    //-->
    </SCRIPT>
    </HEAD><BODY onmousemove="doMove()">
    <div id="strdiv" style="position:absolute; width:445px; z-index:1;left:182px; top: 198px; height: 311px; display:block;background-color:#003333;"><span style="cursor:hand;width:100%;background-color:yellow" onmousedown="startMove()" onmouseup="stopMove()"> <a href="javascript:document.all('strdiv').style.display='none';">关闭<a></span></div></BODY>
    </HTML>