那如果可以延迟一些,能不能搞?
我自己试试 用setcapture...
可以跳动一下 然后就出现"拒绝访问", 
我也明白 当浏览器移动时候 鼠标与浏览器相对位置就移动了 setcapture就会有问题
所以这条路行不通, 不知道有没有其他

解决方案 »

  1.   

    你要实现的是,在IE里面按住一个东西。。然后来拖动IE是不是?
      

  2.   


    <html>
    <head>
    <style type="text/css">
    div
    {
    position:absolute;
    top:200px;
    left:250px;
    width:100px;
    height:100px;
    background-color:c0c0c0;
    cursor:hand;
    }
    </style> <script type="text/javascript">
    function $(id)
    {
    return document.getElementById(id);
    }; function initial()
    {
    window.resizeTo(600,600);
    };

    var isDrag=false;

    function moveWindow()
    {
    isDrag=!isDrag;
    if(isDrag)
    {
    $("div1").style.backgroundColor="#ff3456";
    $("div1").innerText="Move mouse to drag me";
    e=event;
    var startX=e.clientX;
    var startY=e.clientY;
    window.onmousedown=function(){return false;};
    document.onmousemove=function(){if(e.button!=1)startMove(startX,startY,e);};
    }
    else
    {
    $("div1").style.backgroundColor="";
    $("div1").innerText="Click me";
    }
    };

    function startMove(startX,startY,e)
    {
    var deltaX=e.clientX-startX;
    var deltaY=e.clientY-startY;
    var newX=window.screenLeft+deltaX;
    var newY=window.screenTop+deltaY;
    if(newX>0 && newY>0 && isDrag)
    {
    try
    {
    window.moveBy(deltaX,deltaY);
    }
    catch(e)
    {}
    }
    };
    </script>
    </head>
    <body onload="initial()">
    <div onselectstart="return false;" onmousedown="moveWindow();" id="div1">click me</div>
    </body>
    </html>将就了.....-_-!