简体   繁体   中英

javascript canvas: chrome touch screen not working

I have a project created with canvas. This project works fine on every browser on my iMac (Safari, Chrome, Opera, IE, Mozilla). For this I have created a normal click function:

$('#canvas').click(function(e) {}

When opening this project on a Windows7 SmartBoard (with Multisync s521-p nec) it also works fine, except at Chrome, you cannot touch it. If you click with the mouse on the SmartBoard, that is not a problem at all, but you just cannot touch it with the fingers. Since my project will just be used on this SmartBoard, and preferable at Chrome I really need to fix this, but I have no idea how.

Use Javascript touch events instead of click :

https://developer.mozilla.org/en-US/docs/DOM/Touch_events#Setting_up_the_event_handlers

click is a mouse operation and because the device has "mouse" it is reserved for it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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