jQuery Bootstrap 3 RC 1 中的 typeahead JavaScript 模块在哪里?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17903645/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where is the typeahead JavaScript module in Bootstrap 3 RC 1?
提问by ncubica
As you know Bootstrap RC 1 is here, and I have been reading about all the new awesome features in this new framework. But guess what, typehead is out of the documentation. Does anyone know if this is for any reason?
如您所知,Bootstrap RC 1 已发布,我一直在阅读有关此新框架中所有新功能的信息。但是你猜怎么着,typehead 不在文档中。有谁知道这是否出于任何原因?
I found these exampleswhile googling and also I read in this postthat they changed the typehead Bootstrap. So do I have to add it manually or is it also in the Bootstrap 3 bundle?
我在谷歌搜索时发现了这些例子,并且我在这篇文章中读到他们改变了 typehead Bootstrap。那么我必须手动添加它还是它也在 Bootstrap 3 包中?
Does anyone know something about this?
有没有人知道这件事?
采纳答案by ceejayoz
I believe it has been deprecated in favor of Twitter's excellent typeahead.js. Their documentation has a Bootstrap integration sectionthat should help.
我相信它已被弃用,取而代之的是 Twitter 出色的typeahead.js。他们的文档有一个 Bootstrap 集成部分应该会有所帮助。
edit:Twitter has removed the integration instructions. It's not clear if this is temporary in advance of a Bootstrap 3.0-compatible release or if it's gone for good, but @drye links to a useful replacement at http://www.aureliomerenda.com/install-typeahead-bootstrap-3-fix-css-overlay-width-100/.
编辑:Twitter 已删除集成说明。目前尚不清楚这在 Bootstrap 3.0 兼容版本之前是暂时的还是永久消失,但 @drye 链接到一个有用的替代品,网址为http://www.aureliomerenda.com/install-typeahead-bootstrap-3- fix-css-overlay-width-100/。
回答by Zim
Now that the final Bootstrap 3.0.0 has been released, the typeahead has been officially removed. However, Twitter's Typeahead (https://github.com/twitter/typeahead.js) can be used in it's place:
现在最终的 Bootstrap 3.0.0 已经发布,typeahead 已经被正式删除。但是,Twitter 的 Typeahead ( https://github.com/twitter/typeahead.js) 可以在它的位置使用:
Bootstrap 3 Typeahead example: http://bootply.com/86571
Bootstrap 3 Typeahead 示例:http: //bootply.com/86571
回答by Nukey
I found the adaption [may 2014] ;)
我找到了改编 [2014 年 5 月] ;)
for others landing here from google like I did, still searching for the right answer: https://github.com/bassjobsen/Bootstrap-3-Typeahead
对于像我一样从谷歌登陆这里的其他人,仍在寻找正确的答案:https: //github.com/bassjobsen/Bootstrap-3-Typeahead
and if you need it working with knockout 3 like I do, I adapted the code from the genius Niemeyer ( https://stackoverflow.com/a/20503173/1218136) minimally to work again:
如果您需要像我一样使用淘汰赛 3,我将天才 Niemeyer ( https://stackoverflow.com/a/20503173/1218136)的代码改编为最低限度的再次工作:
<input type="text" data-bind="value: value, typeahead: {source: your_array}" />
回答by Daniel W.
As ceejayoz already stated, you need the typeahead.js + the additional CSS for integrate with Bootstrap.
正如 ceejayoz 已经说过的,你需要 typeahead.js + 额外的 CSS 来与 Bootstrap 集成。
This is made for Bootstrap 2.
这是为 Bootstrap 2 制作的。
If you want it to work with Bootstrap 3, you have to change the .tt-hint
class. I changed it to display: none;
because it overlayed very terrible.
如果您希望它与 Bootstrap 3 一起使用,则必须更改.tt-hint
类。我把它改成display: none;
因为它覆盖的非常可怕。
I also noticed that Button addons (to inputs) don't work that well because the input gets not correctly overridden too.
我还注意到按钮插件(输入)不能很好地工作,因为输入也没有被正确覆盖。
回答by optimister
Yes, typeahead is deprecated in Bootstrap 3.
是的,Bootstrap 3 中不推荐使用 typeahead。
But typeahead.js is not ready for Bootstrap 3.
但是 typeahead.js 还没有为 Bootstrap 3 做好准备。
The working solution is to add the additional css, which repairs the css problems: https://github.com/jharding/typeahead.js-bootstrap.css
工作解决方案是添加额外的 css,修复 css 问题:https: //github.com/jharding/typeahead.js-bootstrap.css