在使用jQuery的移动设备上处理longtap和double-tap事件的最佳方式是什么? [英] What's the best way to handle longtap and double-tap events on mobile devices using jQuery?

查看:131
本文介绍了在使用jQuery的移动设备上处理longtap和double-tap事件的最佳方式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找最佳的解决方案来添加doubletap和longtap事件,以用于jQuery的live(),bind()和trigger()。我滚过我自己的快速解决方案,但这是一个小错误。有没有人有他们会推荐的插件,还是自己想要分享的内容?

I'm looking for the best solution to adding both "doubletap" and "longtap" events for use with jQuery's live(), bind() and trigger(). I rolled my own quick solution, but it's a little buggy. Does anyone have plugins they would recommend, or implentations of their own they'd like to share?

推荐答案

已经报告jQuery作为一个bug,但是作为doubletapping与doubleclicking不一样,它没有高优先级。然而,主管Raul Sanchez编写了一个可以使用的双引号的jquery解决方案!
这里是链接,用于移动Safari。

It has been reported to jQuery as a bug, but as doubletapping isn't the same as doubleclicking, it does not have a high priority. However, mastermind Raul Sanchez coded a jquery solution for doubletap which you can probably use! Here's the link, works on mobile Safari.

很容易使用:

$('selector').doubletap(function() {});

-edit -

-edit-

还有一个longtap插件 here !您可以在iPad或iPhone上看到演示版本 here

And there's a longtap plugin here! You can see a demo on your iPad or iPhone here.

这篇关于在使用jQuery的移动设备上处理longtap和double-tap事件的最佳方式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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