<script type="text/javascript" >
var   Obj   
  function   MouseDown(obj){   
  Obj=obj   
  Obj.setCapture()   
  Obj.l=event.x-Obj.style.pixelLeft   
  Obj.t=event.y-Obj.style.pixelTop   
  }   
  function   MouseMove(){   
  if(Obj!=null){   
  Obj.style.left   =   event.x-Obj.l   
  Obj.style.top   =   event.y-Obj.t   
  }   
  }   
  function   MouseUp(){   
  if(Obj!=null){   
  Obj.releaseCapture()   
  Obj=null   
  }   
  } 
</script><div id="imgbottom" style=" width:96%; height:500px; float:left; border:3px solid #dddddd; margin:0 auto; overflow:hidden;cursor:move;">
             <asp:Image ID="ShowImg"  runat="server"  onmousedown="MouseDown(this)"   onmousemove="MouseMove()"   onmouseup="MouseUp()"   style="position:absolute"/>
          </div>可以移动,但是要设置图片的 style="position:absolute"。这样图片就可以移出div了。而且移出也不hidden我想,图片只在div内移动。移出部分就自动隐藏掉。

解决方案 »

  1.   

    现在好象就是移出DIV就HIDDEN了呀
      

  2.   

    晕,要设置div 和img 的position:relative 
    才行
      

  3.   

    <div style="width:400px;height:400px;position:relative;overflow:hidden">
        <img alt="" src="6.jpg" onmousedown="MouseDown(this)"   onmousemove="MouseMove()"   onmouseup="MouseUp()" style="position:absolute;" />
    </div>
    再加上你那个js
      

  4.   

    可我的ie7里面麽问题啊,先只用上面的html试试