Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 TouchSwipe (http://labs.skinkers.com/touchSwipe/)。我的问题是 swipeStatus 事件回调中的距离是两点之间的距离(开始拖动点和当前拖动点)。我只想分别获得 x 距离或 y 距离。怎么做?
swipeStatus: function(event, phase, direction, distance)
您可以从事件参数中获取 x 和 y 坐标。对于刷卡,即:
event.pageX event.pageY
快乐编码!