简体   繁体   English

来自 https://github.com/thread-pond/signature-pad 的 JS 签名板无法在更大的触摸屏笔记本电脑和台式机上工作

[英]JS signature pad from https://github.com/thread-pond/signature-pad is unable to work on larger touch screens laptops and desktops

I am using the 'jquery.signaturepad.js' library as it appears in the link https://github.com/thread-pond/signature-pad .我正在使用 'jquery.signaturepad.js' 库,因为它出现在链接https://github.com/thread-pond/signature-pad 中 This library has a signature pad (canvas) for mouse/touch screen signature purpose.该库具有用于鼠标/触摸屏签名目的的签名板(画布)。 The touch screen signature works when when the device is an Ipad/Iphone and other smaller devices but not on desktop/laptop touch screens.当设备是 Ipad/Iphone 和其他较小的设备但不在台式机/笔记本电脑触摸屏上时,触摸屏签名有效。

Is there any fix I could make this library to work both using the mouse and the touch screen (if device is touch screen) in all (most) devices?是否有任何修复可以使这个库在所有(大多数)设备中使用鼠标和触摸屏(如果设备是触摸屏)工作?

I have tried it in all browsers and no luck我在所有浏览器中都试过了,但没有运气

I finally found why the event OnTouchStart returns undefined for newer/bigger screen laptops.我终于找到了为什么事件 OnTouchStart 对于更新/更大屏幕的笔记本电脑返回 undefined 。

I have changed my code from canvas.ontouchstart = function(e) {} // which returns undefined to我已经将我的代码从canvas.ontouchstart = function(e) {} // 返回 undefined 更改为

canvas.eddEventListener('touchstart', function(e) {}

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

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