html5 - canvas中的mousedrag事件,为什么鼠标拖出canvas,然后再次移入canvas,drag事件还触发
ringa_lee
ringa_lee 2017-04-17 14:34:00
0
2
685

canvas中的mousedrag事件,为什么鼠标拖出canvas,然后再次移入canvas,drag事件还触发。

移入canvas时,不用按下鼠标也可触发drag事件。真是奇哉怪也。请问下,拖出canvas后如何释放drag事件??

ringa_lee
ringa_lee

ringa_lee

reply all (2)
刘奇

Have you tried event.stopPropagation()

    刘奇

    First of all, how do you write the judgment conditions of your mousedrag event? Is it triggered as soon as you enter the canvas or is it something else? If according to your description, you don't want the mouse to enter the canvas again to trigger the event, then you can just set mousedrag = null;

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!