简体   繁体   English

当所有元素都标记为draggable = false时,在画布上获取拖动事件

[英]getting drag event on canvas when all elements marked draggable=false

I'm using mousedown, mousemove mouseup and mouseout events on a canvas to create a custom drag control. 我在画布上使用mousedown,mousemove mouseup和mouseout事件创建自定义拖动控件。

Now this is working fine,except that occasionally a drag event will be fired, which prevents the mouseup firing which borks it all up. 现在可以正常工作了,只是偶尔会触发一个拖动事件,这会阻止mouseup触发而使一切烦恼。

I have set draggable=false on ALL my elements, yet this still occurs. 我在所有元素上都设置了draggable = false,但这仍然会发生。

I'm using Chrome Version 27.0.1453.116 m and the app is in Angularjs Also using twitter bootstrap 我正在使用Chrome版本27.0.1453.116 m,并且该应用程序位于Angularjs中,同时也在使用twitter bootstrap

cheers 干杯

Edit: put up some code https://gist.github.com/neilmanuell/5917036 编辑:输入一些代码https://gist.github.com/neilmanuell/5917036

I solved this issue by re architecture my application. 我通过重新构建应用程序解决了这个问题。 The issues I was getting with unwanted mouse events being fired seemed to be issues with browser implementation. 我因触发不必要的鼠标事件而遇到的问题似乎与浏览器实现有关。 my original approach was flawed as it was coming from an as3 way of doing things. 我最初的方法有缺陷,因为它来自as3的处理方式。 once i'd approached the problem in a more html way the mouse events were no longer an issue. 一旦我以更多的html方式解决了这个问题,鼠标事件就不再是问题了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM