如何使ondblclick事件在手机上工作? [英] How to make ondblclick event works on phone?

查看:156
本文介绍了如何使ondblclick事件在手机上工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在特定div上实现双击事件,如下所示:

I want to achieve the double click event on a specific div like this:

<div   id="divID" ondblclick = 'alert("double click!!");' >

它在谷歌浏览器浏览器上工作但是当我用手机打开它时它无效单击工作的方式。

it worked on the google chrome browser but when I open it with phone it didn't work, by the way the single click worked.

ps:我添加了这两件事

ps: i added this two things

<meta name="viewport" content="width=device-width, initial scale=1,user-scalable=no">

body {
-ms-touch-action: manipulation;
touch-action: manipulation;}

但它没有用!

推荐答案

将jQuery Mobile加载到您的项目中并尝试使用 taphold 或其他一些特定的移动设备触摸通过该API可用的事件。

Load jQuery Mobile into your project and try using taphold or some of the other mobile specific touch events that are available to you through that API.

这是包含您可以使用的所有事件的jQuery Mobile文档: http://api.jquerymobile.com/category/events/

Here's the jQuery Mobile documentation with all the events you can use: http://api.jquerymobile.com/category/events/

这篇关于如何使ondblclick事件在手机上工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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