[英]jQuery - auto suggest/complete?
I'm looking for a good solution for an autocomplete/autosuggest jQuery plugin. 我正在为自动完成/自动建议的jQuery插件寻找一个好的解决方案。 The ones I have found stops auto-completing/suggesting after a value is selected.
选择一个值后,我发现的代码会停止自动完成/建议。 I'm trying to mimic Google Suggest.
我正在尝试模仿Google建议。
For example, say I provide the following options: 例如,说我提供以下选项:
When user type in a
, the user should be presented with aaa
. 当用户键入
a
,应向用户显示aaa
。 If user selects that, then presses a space (meaning, user is getting ready to type some more), I want bbb
and ccc
still available to the user when he/she is typing. 如果用户选择了该选项,然后按一个空格(表示用户已准备好再输入一些内容),我希望用户在输入时仍可以使用
bbb
和ccc
。
Any suggestions for what I might be able to use? 关于我可能会使用的任何建议吗?
(NOTE: Perhaps Google Suggest actually behaves the same way as the available plugins. Perhaps its list of options just contain every possible permutation of what the user might type.) (注意:也许Google建议实际上与可用插件的行为相同。也许它的选项列表仅包含用户键入内容的所有可能排列。)
You can try this one: nicolasbize.github.com/magicsuggest 您可以尝试以下一种方法:nicolasbize.github.com/magicsuggest
You will get the desired behaviour with the following code: 您将通过以下代码获得所需的行为:
new MagicSuggest({
focusOnExpand: true,
data: 'aaa,bbb,ccc',
renderTo: $('#your-div-id')
})
disclaimer: i am the author 免责声明:我是作者
Yeah, I think your right about google having every possible permutation. 是的,我认为您对Google具有一切可能的排列的权利。
I would suggest keeping with the standard jquery autocomplete plugin (http://docs.jquery.com/Plugins/autocomplete). 我建议保持标准的jquery自动完成插件(http://docs.jquery.com/Plugins/autocomplete)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.