How do I drag an image smoothly around the screen using pure javascript

后端 未结 4 670
情书的邮戳
情书的邮戳 2021-01-30 14:15

I\'m trying to use JavaScript drag an image around the screen. I\'ve already written a script that works fine on divs with text, but when I use it on a image it works very inter

4条回答
  •  悲哀的现实
    2021-01-30 15:11

    Simply add return false at the end of your startDrag function to keep the browser from handling the click event.

提交回复
热议问题