我尝试使用jQuery Ui进行自动完成,实时显示大量结果。
像this:
$(function () {
var projects = [{
value: "jquery",
label: "jQuery",
desc: "the write less, do more, JavaScript library",
icon: "jquery_32x32.png"
}, {
value: "jquery-ui",
label: "jQuery UI",
desc: "the official user interface library for jQuery",
icon: "jqueryui_32x32.png"
}, {
value: "sizzlejs",
label: "Sizzle JS",
desc: "a pure-JavaScript CSS selector engine",
icon: "sizzlejs_32x32.png"
}];
$("#project").autocomplete({
minLength: 0,
source: projects,
response: function (event, ui) {
var len = ui.content.length;
$('#count').html('Founded ' + len + ' results');
}
});
});
但适用于我更复杂的脚本here。
有人知道如何整合吗? 非常感谢。