网站搜索的下拉结果 [英] Dropdown Results for Website Search

查看:77
本文介绍了网站搜索的下拉结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否存在用于创建网站搜索的服务或解决方案,该服务或解决方案将使我可以将结果填充到搜索栏下方的下拉窗口中,而不必将结果填充到新页面中。有点像Google的单词预测/建议,但不是即时的建议,我希望有一个新的DIV在提交后随结果一起显示。



The我正在使用的网站位于:


I am wondering if there is a service or solution to creating a website search that will allow me to have the results populate into a dropdown window below my search bar, rather than have to populate the results to a new page. Kind of like google's word prediction/suggestion, but rather than on-the-fly suggestions, I would like a new DIV to drop down with the results upon submission.

The website I am working on is at: http://www.conceptsuppliers.com/beta

解决方案

I highly recommend using the jQuery Tokeninput plugin. I recently implemented this on a site for live searching functionality and it works perfectly.

The library provides options for styling every aspect of the search bar and dropdown results list.

Example:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery.tokeninput.js"></script>
<link rel="stylesheet" type="text/css" href="token-input.css" />

<script type="text/javascript">
$(document).ready(function () {
    $("#searchbar").tokenInput("/url_to_your_search_endpoint");
});
</script>

The plugin can be found, along with documentation, here: http://loopj.com/jquery-tokeninput/

这篇关于网站搜索的下拉结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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