使用 jQuery 手风琴时在页面上查找字符串 (Ctrl+F) [英] Find String on Page (Ctrl+F) when jQuery Accordion in Use
问题描述
我正在使用 jQuery 手风琴插件来折叠大页面.它工作得很好,是一种压缩页面的好方法,但我注意到当使用浏览器搜索功能查找 (Ctrl+F) 时,它只在打开的 div
中查找搜索字符串.
I am using jQuery accordion plugin to collapse a large page. It works nicely and is a great way to compact the page but I noticed that when using the Browser search function find (Ctrl+F) it only looks in the open div
for the search string.
有没有办法让浏览器找到搜索所有 div
s(如果找到的话甚至可能打开它们)......我明白为什么这不是微不足道的.搜索必须打开 div
s 才能显示结果,这并不明显...
Is there a way to get the browser find to search through all the div
s (and maybe even open them if found)... I see why this is not trivial. The search would have to open the div
s to show results and this is not obvious...
如果没有明显的方法来解决这个问题,那么以编程方式执行此操作的方法是什么?
If there isn't an obvious way to get around this, what would be the approach to doing this programatically?
有什么想法吗?
推荐答案
我选择了这个选项,如别处所述:
I went with this option, as described elsewhere:
我为用户提供了一个选项来同时切换手风琴,然后他们可以使用 Ctrl+F 进行搜索.
I give the user an option to toggle the accordion all together and then they can search with Ctrl+F.
这篇关于使用 jQuery 手风琴时在页面上查找字符串 (Ctrl+F)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!