Touchscreen
触摸屏类在相对于视口左上角的主框架 CSS 像素中运行。触摸屏上的方法只能在已初始化并将 hasTouch 设置为 true 的浏览器上下文中使用。
🌐 The Touchscreen class operates in main-frame CSS pixels relative to the top-left corner of the viewport. Methods on the touchscreen can only be used in browser contexts that have been initialized with hasTouch set to true.
此类仅限于模拟轻触手势。有关通过手动分发触摸事件来模拟其他手势的示例,请参见 模拟旧版触摸事件 页面。
🌐 This class is limited to emulating tap gestures. For examples of other gestures simulated by manually dispatching touch events, see the emulating legacy touch events page.
方法
🌐 Methods
tap
Added before v1.9在位置 (x, y) 使用单次触摸分派 touchstart 和 touchend 事件。
🌐 Dispatches a touchstart and touchend event with a single touch at the position (x,y).
note