我正在使用ui自动完成:
over here
我需要始终打开自动完成功能,因此在单击身体某处时不应该关闭它.我用谷歌搜索了但我找不到任何东西.
解决方法
这是一个如何做到的工作示例:
http://jsfiddle.net/4pk3V/
每当触发关闭事件时,通过再次搜索相同的输入来保持自动完成框打开:
$( "#input" ).autocomplete({
source: availableTags,close : function (event,ui) {
val = $("#comment").val();
$("#input").autocomplete( "search",val ); //keep autocomplete open by
//searching the same input again
$("#input").focus();
return false;
}
});