我可以使用功能检测来了解 css悬停是否适用于该客户端吗?
我有一个网站,当用户将鼠标悬停在图像上时提供标签。您可以在以下位置查看该示例: http://www.185vfx.com/
对于触摸屏,我会喜欢默认打开这些提示(因为悬停通常不可用)。我不想浏览器嗅探并尝试在新设备/版本到达时维护该列表。
有什么可靠的方法来检测浏览器是否可以响应悬停或通过 JavaScript 或 CSS 了解触摸屏用户?
I've got a website that provides labels when the user hovers over an image. You can see the example at: http://www.185vfx.com/
For touchscreens, I'd like to have those hints on by default (since hover isn't usually available). I'd prefer not to browser-sniff and try to maintain that list as new devices/versions arrive.
Any reliable way to detect if a browser can respond to hover or otherwise know about a touchscreen user via javascript or css?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不会。
即使他们有触摸屏,他们也可能会使用鼠标。就此而言,无论他们是否有触摸屏,他们都可能使用键盘(或呼吸开关或其他东西)进行导航,但仍然无法悬停。
最好不要首先将重要信息放在悬停显示后面(或者至少始终提供另一种访问它的方法)。
No.
Even if they do have a touchscreen, they might be using a mouse anyway. For that matter, whether they have a touchscreen or not, they might be using a keyboard (or a breath switch or something else) to navigate and still be unable to hover.
It is best not to put important information behind a hover reveal in the first place (or at least to always provide another means to access it).