在触控手机使用Javascript检测手指的阻力? [英] Detect finger drag using Javascript on touch phones?
问题描述
有没有一种方法来检测手指在触控手机使用Javascript拖再拖?我目前使用jQuery和鼠标移动()方法不会出现我的Andorid手机上运行。
Is there a way to detect finger drags using Javascript on touch phones? I'm currently using jQuery and the mousemove() method doesn't appear to work on my Andorid phone.
编辑:我想我应该澄清的是,这是一个Web应用程序
I suppose I should clarify that this is for a web application.
编辑2:我发现我的问题的一个副本几分钟前:<一href=\"http://stackoverflow.com/questions/2264072/detect-a-finger-swipe-through-javascript-on-the-iphone-and-android\">Detect通过JavaScript手指轻扫在iPhone和Android 。虽然,它没有一个公认的答案。
EDIT 2: I found a duplicate of my question a few moments ago: Detect a finger swipe through JavaScript on the iPhone and Android. Although, it does not have an accepted answer.
推荐答案
使用的<一个href=\"http://stackoverflow.com/questions/4755505/how-to-recogized-touch-event-using-jquery-for-ipad-safari-browser-is-it-possible\">analogous触摸事件:在 touchstart
, touchmove
, touchcancel
和 touchend
。要绑定为这些事件的一个事件侦听器,你将不得不使用,例如 .bind('touchmove',...)
而不是 .touchmove(...)
,因为jQuery不提供方便的方法。
Use the analogous touch events: touchstart
, touchmove
, touchcancel
, and touchend
. To bind an event listener for one of these events, you'll have to use, for example .bind('touchmove', ...)
instead of .touchmove(...)
, because jQuery does not provide convenience methods.
这篇关于在触控手机使用Javascript检测手指的阻力?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!