Events— 'mouseup' not firing after mousemove

前端 未结 5 1161
慢半拍i
慢半拍i 2020-12-08 19:37

I am trying to drag an image with Javascript (no libraries). I am able to listen to mousedown and mousemove events. For some reason, I am not able

5条回答
  •  执笔经年
    2020-12-08 20:19

    Strangely, I've found that when I set my text as unselectable using the below CSS, that inhibits the mouseup event from firing as well -- perhaps this will help someone else.

    -moz-user-select: none;
    -khtml-user-select: none;
    user-select: none;
    

提交回复
热议问题