Twitter bootstrap 引导式打字机
我正在使用引导typeahead实现自动完成功能。 我需要typeahead在输入激活时返回结果(在鼠标单击或对输入进行制表),而不是等待用户键入第一个字符。更像是一个打字记录Twitter bootstrap 引导式打字机,twitter-bootstrap,autocomplete,Twitter Bootstrap,Autocomplete,我正在使用引导typeahead实现自动完成功能。 我需要typeahead在输入激活时返回结果(在鼠标单击或对输入进行制表),而不是等待用户键入第一个字符。更像是一个打字记录 <input id="input01" class="input-medium" type="text" data-provide="typeahead" placeholder="TypeAhead…" autocomplete="off"> $(document).ready(function($)
<input id="input01" class="input-medium" type="text" data-provide="typeahead" placeholder="TypeAhead…" autocomplete="off">
$(document).ready(function($) {
// Workaround for bug in mouse item selection
$.fn.typeahead.Constructor.prototype.blur = function() {
var that = this;
setTimeout(function () { that.hide(); }, 250);
};
$('#input01').typeahead({
source: function(query, process) {
return ["hello","world", "awesome"];
}
});
});
$(文档).ready(函数($){
//鼠标项目选择中错误的解决方法
$.fn.typeahead.Constructor.prototype.blur=function(){
var=这个;
setTimeout(函数(){that.hide();},250);
};
$('#input01')。请提前键入({
来源:功能(查询、流程){
return[“你好”,“世界”,“很棒”];
}
});
});
我没有使用过该插件,但尝试手动调用查找(或现在的任何方法)
大概是这样的:
$(document).ready(function($) {
var $input = $('#input01');
$input.typeahead({
source: function(query, process) {
return ["hello","world", "awesome"];
}
});
$input.on('focus', function() {
$input.typeahead.lookup();
});
});
工作正常功能仍在查找中,但没有帮助。