我正在尝试获取触摸位置的恒定坐标,不幸的是,当我运行应用程序时,我注意到在激活“touchmove”之前需要超过像素阈值或其他东西。有没有办法改变这个阈值?或者也许是别的什么?(最好不要使用 JQuery)
怎么了:
触摸 = 即时 X、Y 坐标
Move Touch around = X,Y 坐标在“通过一定数量的像素”(阈值?)之前不会改变
document.addEventListener('touchstart', onDocumentTouchStart, false);
document.addEventListener('touchmove', onDocumentTouchMove, false);
function onDocumentTouchStart(event)
{
for(var i = 0; i < event.touches.length; i++)
{
clickX[i] = event.touches[i].pageX;
clickY[i] = event.touches[i].pageY;
}
}
function onDocumentTouchMove(event)
{
for(var i = 0; i < event.touches.length; i++)
{
clickX[i] = event.touches[i].pageX;
clickY[i] = event.touches[i].pageY;
}
}