Events— 'mouseup' not firing after mousemove

前端 未结 5 1162
慢半拍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:26

    Found the issue, if it is going to be of help to anyone:

    I added event.preventDefault(); in the mousedown event and now I am getting mouseup notifications.

提交回复
热议问题