We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
包版本1.1.3 机型:安卓 环境:微信环境 这个错误信息 undefined is not an object (evaluating 't.touches[1].clientX') 表示在JavaScript 代码中尝试访问 t.touches[1].clientX 时,t.touches[1] 是 undefined,即 t.touches 数组没有第二个元素。
这个问题的发生通常有以下几种情况: 没有足够的触摸点:当事件发生时,可能只有一个触摸点,但代码试图访问第二个触摸点。 事件触发时机不正确:某些事件类型在触摸点还未更新时被触发,导致访问的触摸点数组不完整。
建议修复为检查数量再访问: element.addEventListener('touchmove', function (event) { if (event.touches.length > 1) { var touch1 = event.touches[0]; var touch2 = event.touches[1]; // 处理多点触控逻辑 } else { console.log('只有一个触摸点'); } });
The text was updated successfully, but these errors were encountered:
ok 我看看,在双指缩放时兼容处理下,如果只有一个触摸点,不走下面逻辑
Sorry, something went wrong.
好滴,谢谢大佬~
No branches or pull requests
包版本1.1.3
机型:安卓
环境:微信环境
这个错误信息 undefined is not an object (evaluating 't.touches[1].clientX') 表示在JavaScript 代码中尝试访问 t.touches[1].clientX 时,t.touches[1] 是 undefined,即 t.touches 数组没有第二个元素。
这个问题的发生通常有以下几种情况:
没有足够的触摸点:当事件发生时,可能只有一个触摸点,但代码试图访问第二个触摸点。
事件触发时机不正确:某些事件类型在触摸点还未更新时被触发,导致访问的触摸点数组不完整。
建议修复为检查数量再访问:
element.addEventListener('touchmove', function (event) {
if (event.touches.length > 1) {
var touch1 = event.touches[0];
var touch2 = event.touches[1];
// 处理多点触控逻辑
} else {
console.log('只有一个触摸点');
}
});
The text was updated successfully, but these errors were encountered: