문제

I made sort of a mobile game with HTML5 and JavaScript. I only get a big problem when I open the game in my browser on my localhost (on my mobile)! To make one thing clear: I run it in my mobile browser, so it is not like an app.

This thing is when I touch the screen on my mobile, it has a little delay before it runs the action. Also the game got a sort of selected when I click on it. Just to be sure: I have used the ONCLICK event.

So my question is: What am I doing wrong? Am I picking wrong event handlers for mobile devices or something in that way, or do I put my FPS (Frames Per Second) rate too high for a mobile device?

PS. The game is tested with an iPhone 4s on Safari!

도움이 되었습니까?

해결책

Many people have encountered this problem before. You can remove this delay by adding a small library named "fastclick.js". Here is a simple solution which works quiet fine for me. Stop 300ms onclick delay on Android web browser

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top