使用 jQuery 手风琴时在页面上查找字符串 (Ctrl+F) [英] Find String on Page (Ctrl+F) when jQuery Accordion in Use

查看:27
本文介绍了使用 jQuery 手风琴时在页面上查找字符串 (Ctrl+F)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 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.

有没有办法让浏览器找到搜索所有 divs(如果找到的话甚至可能打开它们)......我明白为什么这不是微不足道的.搜索必须打开 divs 才能显示结果,这并不明显...

Is there a way to get the browser find to search through all the divs (and maybe even open them if found)... I see why this is not trivial. The search would have to open the divs 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屋!

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