我想将ctrl+ f命令与搜索框一起使用
我想在虚拟旅行工作中使用诸如CTRL+F之类的搜索。首先,这项研究的地址为 360franke.com
我有一个index.html文件。几乎所有工作,
<body>
<div id="viewer" class="fill_viewport"></div>
</body>
都与此Div一起显示。
我可以在浏览器中找到带有Ctrl+F的菜单项(例如Konseptler,Katalog)。但是我想用搜索按钮,而不是ctrl+f重定向。我尝试过的许多方法都没有起作用。非常感谢您的建议。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您只需要捕获事件并将搜索栏聚焦
此代码将CTRL + F,CMD + F和F3重定向到输入
You just have to capture event and focus the search bar
This code redirects ctrl + F, cmd + F and F3 to an input
您不能覆盖默认浏览器 cmd + f 函数;但是,这种常见的实现是 cmd + k 而不是(请参阅)。
看看这个演示:
请记住,在Mac和Windows之间,关键人物习惯于使用不同。在Mac上,我们使用 cmd ,而Windows使用 ctrl ,因此我们在此处介绍了两种情况。
You can't override the default browser CMD + F functionality; however, a common implementation of this is with CMD + K instead (see this website).
Take a look at this demo:
Keep in mind that between Mac and Windows, the key people are used to using is different. On Mac, we use CMD, while Windows uses CTRL, so we've covered both cases here.