zoukankan      html  css  js  c++  java
  • javascript 層的拖動


    <script   language="JavaScript"> 
      <!-- 
      var   Obj; 
      function   MouseDown() 
      { 
          Obj=document.getElementById("dragDiv"); 
          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; 
          } 
      } 
      document.onmousedown=MouseDown; 
      document.onmousemove=MouseMove; 
      document.onmouseup=MouseUp 
      //--> 
      </script> 
      <div   id="dragDiv"   style="position:absolute;500px;height:100px;">11111 
    adsgadsgfasdgf  </div>
  • 相关阅读:
    concurrent-锁
    字符串查找字符串
    指针作为函数返回值
    数组名作为函数参数
    指针和函数
    多级指针
    指针数组
    指针运算
    指针和数组
    const修饰的指针类型
  • 原文地址:https://www.cnblogs.com/Bluer/p/770921.html
Copyright © 2011-2022 走看看