在使用jQuery的移动设备上处理longtap和double-tap事件的最佳方式是什么? [英] What's the best way to handle longtap and double-tap events on mobile devices using jQuery?
问题描述
我正在寻找最佳的解决方案来添加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屋!