onmouseup的位置

来源:4-2 [DOM事件] QQ面板拖拽效果(下)

江爱笛生

2016-04-05 18:04

function drag(){
   var oTitle=getByClass('login_logo_webqq','loginPanel')[0];
   // 拖曳
   oTitle.onmousedown=fnDown;
   // 释放鼠标
 document.onmouseup=function(){
   document.onmousemove=null;
   document.onmouseup=null;
  };
}这样为什么释放鼠标就第一次成功有效呢

写回答 关注

2回答

  • 深山小童
    2016-04-13 22:58:56

    嗯,同求解答,知道了告诉我下哈,兄台

    深山小童

    我在想把document.onmouseup写在外面是不是检测不到已经在fnDown里生效的document.onmousemove,删除不了它。但是第一次又为何可以

    2016-04-13 23:03:35

    共 1 条回复 >

  • 江爱笛生
    2016-04-05 18:05:53

    document.onmouseup=function(){
       document.onmousemove=null;
       document.onmouseup=null;
      };原本在fnDown内部

DOM事件探秘

DOM事件?本课程会通过实例来给小伙伴们讲解如何使用这些事件

99532 学习 · 1300 问题

查看课程

相似问题