在 PC 浏览器上模拟触摸事件 [英] Simulating touch events on a PC browser

查看:30
本文介绍了在 PC 浏览器上模拟触摸事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 iPad 开发 HTML 应用程序.因此,它利用触摸事件和 webkit-CSS 动画.

I am developing an HTML application for the iPad. As such it utilizes touch events and webkit-CSS animations.

到目前为止,我一直使用 chrome 作为我的调试环境,因为它非常棒的开发者模式.

Up until now I have used chrome as my debugging environment because of it's awesome developer mode.

我想要的是能够在我的 PC 上使用 Google-Chrome 的调试器调试我的 Html/JavaScript,同时用我的鼠标模拟触摸事件.

What I would like is to be able to debug my Html/JavaScript using Google-Chrome's debugger on my PC while simulating touch events with my mouse.

我的网站没有任何多点触控事件,也没有鼠标事件(iPad 上没有鼠标).

My site does not have any multi-touch events and no mouse events (no mouse on iPad).

我实际上对查看应用程序布局并不感兴趣,而更感兴趣的是调试其行为.

I am not actually interested in seeing the applications layout, but more in debugging its behavior.

是否有一些插件可以将鼠标事件转换为桌面浏览器上的触摸事件?

Is there some plugin to get mouse events translated into touch events on a desktop browser?

推荐答案

截至 2012 年 4 月 13 日

在 Google Chrome 开发者和金丝雀版本中,现在有一个模拟触摸事件"复选框

In Google Chrome developer and canary builds there is now a checkbox for "Emulate touch events"

您可以通过打开 F12 开发者工具并点击屏幕右下角的齿轮找到它.

You can find it by opening the F12 developer tools and clicking on the gear at the bottom right of the screen.

目前(Chrome ver.36.0.1985.125)你可以在这里找到它:F12 => Esc => Emulation.

For now (Chrome ver.36.0.1985.125) you can find it here: F12 => Esc => Emulation.

这篇关于在 PC 浏览器上模拟触摸事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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