【发布时间】:2014-08-19 13:38:45
【问题描述】:
有人可以帮助找出这段代码有什么问题吗,预先输入似乎不起作用。任何帮助都非常受欢迎。
<html>
<head>
<link href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div style="margin: 50px 50px">
<label for="product_search">Product Search: </label>
<input id="product_search" type="text" data-provide="typeahead">
</div>
<script src="js/jquery-1.10.2.js"></script>
<script src="js/bootstrap-typeahead.js"></script>
<script>
$(document).ready(function($) {
// Workaround for bug in mouse item selection
$.fn.typeahead.Constructor.prototype.blur = function() {
var that = this;
setTimeout(function () { that.hide() }, 250);
};
$('#product_search').typeahead({
source: function(query, process) {
return ["Deluxe Bicycle", "Super Deluxe Trampoline", "Super Duper Scooter"];
}
});
});
</script>
</body>
</html>
【问题讨论】:
-
预输入有什么问题?
标签: jquery html css twitter-bootstrap bootstrap-typeahead