gpt4 book ai didi

twitter-bootstrap-3 - 如何在 bootstrap 3 中使用 typeahead.js?

转载 作者:行者123 更新时间:2023-12-05 01:04:53 24 4
gpt4 key购买 nike

我正在组合一个原型(prototype)应用程序进行演示,并且正在使用 Twitter Bootstrap 3(http://getbootstrap.com - 特别是版本 3.1.1)。我想使用 typeahead.js (http://twitter.github.io/typeahead.js/ - 当前版本 0.10.1) 来驱动搜索建议。

我已经看到了一些以前版本的示例,但没有一个与最新版本相关。

将两者结合起来的最佳方法是什么?

根据我看到的几个例子,这就是我想要做的

<input type="text" class="typeahead form-control input-sm" id="searchField1"/>

进而
$(document).ready(function() {
$('#searchField1').typeahead({
name: 'keywords',
local: ['foo', 'bar']
});
});

然而,我认为事情已经发生了变化

最佳答案

twitter.github.io/typeahead.js 与 Bootstrap 3 不兼容。

你可以用这个提前输入 与 twitter bootstrap 3 兼容

https://github.com/bassjobsen/Bootstrap-3-Typeahead

实际上,开发人员将 bootstrap 2 代码迁移到 bootstrap 3 这里是详细信息 http://bassjobsen.weblogs.fm/migrate-your-templates-from-twitter-bootstrap-2-x-to-twitter-bootstrap-3/

关于twitter-bootstrap-3 - 如何在 bootstrap 3 中使用 typeahead.js?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22309355/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com