搜索并滚动到页面上的单词 [英] Search and scroll to word on page

查看:105
本文介绍了搜索并滚动到页面上的单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的客户希望在特定页面上添加一个搜索框,以允许其用户搜索产品,并滚动到该文本.这样一来,她就可以更轻松地将客户引导到页面的右侧.

My client wants to add a search box on specific pages that will allow their user to search for a product and it will scroll to that text. This way it's easier for her to direct her clients to the right part of the page.

使用带有浏览器搜索功能的Ctrl-F可以轻松完成此操作.不幸的是,客户希望搜索成为网站的一部分.

This is easily done using Ctrl-F with the browsers search function. Unfortunately the client wants the search to be part of the site.

有关如何实现此目标的任何建议?我一直在努力寻找一个wordpress插件,而我在互联网上使用的任何JQuery代码都使我失败了.

Any advice on how to accomplish this? I've struggled to find a wordpress plug-in and any JQuery code I've used around the internet has failed me.

请多谢!

推荐答案

不确定其浏览器是否支持,但是您可以调用window.find("your query here")来使用浏览器的Ctrl + F功能

Not sure about its browser support, but you can call window.find("your query here") to use the browser's Ctrl+F functionality

此处有更多信息

这篇关于搜索并滚动到页面上的单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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