我想了解jquery提及插件jquery mentions,我在插件中遇到了这个部分。任何人都可以解释这是什么意思?最后的返回函数特别是做了什么? 我想关闭自动完成下拉当匹配值具有长度小于4jquery提到jquery ui自动完成
search: function (value, event) {
var match, pos;
//&& value.length >= this.options.minChars
if (!value) {
//sel = window.getSelection();
//node = sel.focusNode;
value = this._value();
pos = Selection.get(this.element).start;
value = value.substring(0, pos);
match = this.matcher.exec(value);
if (!match || match[1].length <= this.options.minChars) {
return '';
}
this.start = match.index;
this.end = match.index + match[0].length;
this.searchTerm = match[1];
//this._setDropdownPosition(node);
}
return $.ui.autocomplete.prototype.search.call(this, this.searchTerm, event);
}
谢谢,但我解决了这个问题。 :) 现在我坚持将自动完成下拉菜单放在textarea中的光标处。我GOOGLE了并尝试了所有的解决方案,但没有运气。 – orangespark