为什么按钮需要很长时间来响应离子中的ng-mousedown?

时间:2022-11-28 23:01:30

I have been trying to develop a very basic game using Ionic. Initially, I was using pure JavaScript to listen to clicks and then act on them but the response time was very long. When I asked a question on Stack overflow, it was suggested that I should be using Angular JS to work optimally with Ionic apps. Now, I have started using Ionic but the response time is still very very slow.

我一直在尝试使用Ionic开发一款非常基本的游戏。最初,我使用纯JavaScript来听取点击,然后对它们采取行动,但响应时间很长。当我询问有关Stack溢出的问题时,有人建议我应该使用Angular JS与Ionic应用程序进行最佳协作。现在,我已经开始使用Ionic,但响应时间仍然很慢。

I am using ng-mousedown and ng-mouseup to detect mouse down and mouse up events. The buttons are positioned absolutely over a canvas element which occupies all the screen space. A single tap on any of the buttons results in no response. I have to keep the button pressed for some time before the logic kicks in. There is no such lag on my PC. Can anyone please guide me on how can I improve the response time?

我正在使用ng-mousedown和ng-mouseup来检测鼠标按下和鼠标按下事件。按钮绝对位于占据所有屏幕空间的画布元素上。只需轻按任何按钮,即可获得任何响应。在逻辑开始之前,我必须按住按钮一段时间。我的电脑上没有这样的延迟。任何人都可以指导我如何改善响应时间?

Let me know if I need to add any code here but it doesn't seem to be a problem with the code because there is no such issue on PC.

如果我需要在这里添加任何代码,请告诉我,但这似乎不是代码的问题,因为PC上没有这样的问题。

1 个解决方案

#1


0  

Try this...It should solve your problem..Actually the ionic.js is sometimes responsible for delays Ionic handle delay

试试这个...它应该解决你的问题。实际上,ionic.js有时会导致延迟离子处理延迟

Eventually, their may be a system performance related issue.If, other apps are lagging behind.

最终,他们可能是系统性能相关的问题。如果,其他应用程序滞后。

#1


0  

Try this...It should solve your problem..Actually the ionic.js is sometimes responsible for delays Ionic handle delay

试试这个...它应该解决你的问题。实际上,ionic.js有时会导致延迟离子处理延迟

Eventually, their may be a system performance related issue.If, other apps are lagging behind.

最终,他们可能是系统性能相关的问题。如果,其他应用程序滞后。