浏览器Ctrl + F找到不可见的文本 [英] Browser Ctrl+F find non-visible text

查看:175
本文介绍了浏览器Ctrl + F找到不可见的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以将 Ctrl + F 的浏览器功能与弹出式窗口中的文字整合。



我想在网页上的某个物种名称悬停时提供一些科学参考信息。生成弹出窗口,工具提示样式的文本是没有问题的,问题是任何使用 Ctrl + F 的人都无法找到它,或者如果我将文本当不需要的时候,它会被发现,但是不可见。



同样的效果适用于手风琴风格的文本区域扩展。
$ b

我正在寻找某种事件,当查找突出显示一个结果时,会产生一些事件。

解决方案

不幸的是,没有这样的事件,你不能干涉内置的查找。



关于你可以做的最好的情况是提供你自己的搜索这个函数在页面中搜索DOM,找到包含给定文本的文本节点,突出显示它们,并打开它们所在的任何关闭的手风琴。


Can the browser feature of Ctrl+F to find text be integrated with text in popup windows.

I'd like to have some scientific reference information given when someone hovers over a species name in a web page. Generating the popup, tooltip style text is no problem, the problem is that anyone using Ctrl+F won't be able to find it, or if I position the text out of view when not required, it will be found but be invisible.

The same sort of effect applies to "accordion" style expanding text areas.

I'm looking for some sort of event generated when find is highlighting a result.

解决方案

Unfortunately there is no such event, you can't interfere with the built-in find.

About the best you can do in this case is to provide your own search function in-page, which searches the DOM for Text nodes containing the given text, highlights them, and opens up any closed accordions they're in.

这篇关于浏览器Ctrl + F找到不可见的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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