如何长按jquery.touchy.js [英] How to use jquery.touchy.js in long press

查看:83
本文介绍了如何长按jquery.touchy.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



你能告诉我如何使用jquery.touchy.js获得长按触摸事件的x和y坐标。



谢谢

Hello

can you please tell me how to get x and y coordinate of long press touch event using jquery.touchy.js .

Thanks

推荐答案

Hello Ravi,



当前版本没有为longpress事件传递此信息。所以你可能需要修改库的源代码。虽然我未经过测试,但以下代码段显示了案例陈述中可能需要的更改

Hello Ravi,

The current version does not pass this information for longpress event. So you probably have to modify the source code of the library. Although not tested by me, the below code snippet shows the possible change required in case statement
case 'longpress':
    data.startPoint = {
        "x": touches[0].pageX,
        "y": touches[0].pageY
    };
    data.startDate = e.timeStamp;
    if (settings.triggerStartPhase) {


target.trigger( ' touchy-longpress',[' 开始'
target.trigger('touchy-longpress', ['start',


target,{
startPoint:data.startPoint}
]);
}
data.timer = setTimeout(
target, { "startPoint": data.startPoint} ]); } data.timer = setTimeout(


这篇关于如何长按jquery.touchy.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆