在隐藏的div中快速查找(ctrl + f) [英] Quick find (ctrl+f) inside hidden div

查看:70
本文介绍了在隐藏的div中快速查找(ctrl + f)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个实现了选项卡的页面,其中不活动的选项卡被display:none隐藏.现在,我正在尝试找到一种使用浏览器quickfind(ctrl + f/cmd + f)在这些隐藏的div中进行搜索的方法

I have a page with tabs implemented, where the inactive tabs are hidden with display:none. Now I'm trying to find a way to search in these hidden divs using the browsers quickfind (ctrl+f / cmd+f)

例如每当用户搜索某些内容时,运行javascript的一种方法?例如,如果用户搜索《模板》,并且仅在其中一个非活动标签中找到该模板,那么我想激活/显示该标签.

Is there e.g. a way to run javascript, whenever a user searches for something? If for example a user searches for «template» and it's found only in one of the inactive tabs, I'd like to activate/show that tab.

有办法吗?还是我必须实现自己的搜索过滤器?

Is there a way? Or would I have to implement an own search filter?

谢谢!

推荐答案

您可以肯定地要求键盘快捷键,但它们仍然可以使用浏览器菜单开始搜索.

Well you can sure ask for the keyboard shortcuts but they can still use the browser menu to start searching.

使用其他方法隐藏这些标签会更容易吗?像

Wouldn't it be easier to use a different method to hide those tabs? Something like

display: block;
height: 0;
width: 0;
overflow hidden;

例如(取决于您的特殊标记/css)

for example (depends on you special markup/css of course)

这篇关于在隐藏的div中快速查找(ctrl + f)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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