Jquery模仿Baidu、Google搜索时自动补充搜索结果提示
2018-10-12 13:51
831 查看
好程序就是懒人喜欢的程序。好程序员就是懒人程序员。昨天研究了一下Jquery 模仿Baidu、Google搜索时自动补充搜索结果的提示,感觉效果还行。特意和大家分享一下。所需Jquery插件。请看代码:
jsp:
<script type="text/javascript">
$().ready( function () {
$(":text").result(auto);
function auto(data){
$("#keyWord").val(data.name);
}
$("#keyWord").autocomplete(obj, {//obj是数据对象数组Json
minChars: 0, //表示在自动完成激活之前填入的最小字符
max: 5, //表示列表里的条目数
autoFill: true, //表示自动填充
mustMatch: false, //表示必须匹配条目,文本框里输入的内容,必须是data参数里的数据,如果不匹配,文本框就被清空
matchContains: true, //表示包含匹配,相当于模糊匹配
scrollHeight: 200, //表示列表显示高度,默认高度为180
formatItem: function (row) {
return row.name;
},
formatMatch: function (row) {
return row.name;
},
formatResult: function (row) {
return row.value;
}
});
});
</script>
jsp:
<div>
<h4> 模仿BaiDu,google搜索提示功能</h4>
<table>
<tr><td>名称:<input type="text" id="keyWord" /></td></tr>
</table>
</div>
您可能感兴趣的文章:
相关文章推荐
- Jquery模仿Baidu、Google搜索时自动补充搜索结果提示
- Jquery 模仿Baidu、Google收索时提示输入结果
- jquery实现自动提示的文本框(仿baidu,google搜索)
- JQuery UI autocomplete自动补全插件搜索结果去除提示
- 仿Google搜索自动提示 jQuery+Ajax
- 用Jquery实现模仿Google 搜索提示功能
- jquery+MVC 实现類似baidu,google搜索 提示下拉框
- jQuery(Ajax)/PHP/MySQL实现搜索自动提示功能
- 搜索pl/sql破解版的时候baidu,google,soso使用的不同结果
- 模仿Google,baidu搜索输入框
- 使用jQuery模拟Google的自动提示效果
- jQuery实现搜索自动提示(搜索筛选)
- autocomplete-自动完成-搜索提示-仿google提示效果
- jQuery.Autocomplete仿baidu、google提示信息
- Google https搜索结果跳转时自动加https的方法
- jQuery实现搜索关键字自动匹配提示方法
- 使用FlexBox和Json实现类似ComboBox(类似Google的输入提示和自动)功能-基于JQuery-ASP.NET
- jQuery自己写的一个类似google自动提示的插件,源代码奉上
- jquery-autocomplete搜索关键字自动补全效果(类似于google)
- google 自动搜索提示工具