本文介绍了jQuery自动完成修改Gmail喜欢匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$("#suggest3").autocomplete(someArray, {
    multiple: true,
    mustMatch: true,
    autoFill: true

});

"Jhon Smith" 
"Borris Baker" 
"Dove Elliot" 

现在在上面的组合中,当我键入"Jhon Smith"时,下拉列表中将提供一个值(Jhon Smith).但是如何进行调整,以使即使我键入"Smith Jhon",仍然是该值( Jhon Smith)可供选择...:s

Now in the above combination when i would type 'Jhon Smith' a value ( Jhon Smith ) will be available in the dropdown....But how to tweak so that even when i type 'Smith Jhon' still the value ( Jhon Smith ) is available for selection... :s

即就像在Gmail中一样,一个人的名字中包含的单词的顺序是什么,只要有"Jhon"和"Smith"就可以显示结果……即顺序无关紧要.

i.e. Like in Gmail no matter what is the sequence of the words included in the name of a person it shows that result as long as the 'Jhon' and 'Smith' is there... i.e. sequence doesn't matter.

推荐答案

以下是Gmail样式匹配的示例: http ://jsbin.com/utojoh/2

Here is an example of Gmail style matching: http://jsbin.com/utojoh/2

例如输入"bl"

这篇关于jQuery自动完成修改Gmail喜欢匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 14:13