obj.onmouseup = function()
    {
         obj.onmousemove=null
        this.releaseCapture();
    }

解决方案 »

  1.   


    基本上正确.
    下面这样更好些   obj.onmouseup = function()
        {
            obj.onmousemove=function(){};
            obj.onmouseup=function(){};
            this.releaseCapture();
        }
      

  2.   

    这样是不行滴.
    最少你得有一个事前的事件FUNCTION,记录未发生事件前的鼠标位置啊.
    然后事件发生后,用EVENT.X与事件前的X对比,造成STYLE的偏移.
    哥们给你一个现成的吧...
    var dragapproved=false
    var z,x,y
    function move()
    {
        if (event.button==1&&dragapproved)          //判断是否为鼠标左键:event.button==1
        {
            z.style.pixelLeft=temp1+event.clientX-x    //鼠标的偏移量:event.clientX-x
            z.style.pixelTop=temp2+event.clientY-y
            return false
        }
    }
    function drags()
    {
        if (!document.all) return
        if (event.srcElement.id=="drag")  //你别说这里你看不懂啊.
        {
            dragapproved=true
            z=document.all.mesWindow;
            temp1=z.style.pixelLeft     //原图左偏移量
            temp2=z.style.pixelTop 
            x=event.clientX                 //鼠标在原图时的坐标X
            y=event.clientY
            document.onmousemove=move   //载入MOVE函数
        }
    }
    document.onmousedown=drags
    document.onmouseup=new Function("dragapproved=false")
      

  3.   

    obj.onmouseup = function()
        {
            obj.onmousemove=null
            this.releaseCapture();
        }