点击iPad无法获得位置和容器信息

编程入门 行业动态 更新时间:2024-10-26 14:27:14
本文介绍了点击iPad无法获得位置和容器信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在chrome或Safari浏览器中,当我选择页面上的文本时,我可以通过 window.getSelection()获取Selection-info,并且它也适用于iPad 。 但是当我点击浏览器时,我会得到一个 window.getSelection(isCollapsed == true),其中包含有关位置和容器的完整信息。在iPad中它只是告诉你选择isCollapsed但位置信息是 0 或 null 。

In chrome or Safari browser, when I select the text on the page I can get the Selection-info by window.getSelection(), And it worked on iPad too. But when I just click , in browser, I will get a window.getSelection (isCollapsed==true) with full infomation about the position and container . In iPad it just tell you the selection isCollapsed but the position info is 0 or null.

当你点击iPad时,任何人都知道如何获取容器和位置信息?

Anyone have an idea how to get the container and the position info when you click in iPad?

推荐答案

基本上使用触摸事件你可以做到这一点。这不仅仅是选择,而是您使用的手指数量。它适用于几乎所有手机上的iPhone上的iPad。为触摸事件设置处理程序后,您可以轻松映射它们以触发点击事件或执行其他操作。

Basically using touch events you could do this. It is not just the selection but the number of the fingers you used too. It works on iPad on iPhones on almost every mobile. After setting your handlers for touch events you can map them easily to fire the click events or do something else.

更多推荐

点击iPad无法获得位置和容器信息

本文发布于:2023-07-20 05:08:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1164495.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:容器   位置   信息   iPad

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!