Questions tagged «typeahead.js»

16
twitter bootstrap typeahead ajax示例
我正在尝试查找twitter bootstrap typeahead元素的工作示例,该示例将进行ajax调用以填充其下拉列表。 我有一个现有的工作jQuery自动完成示例,该示例定义了ajax URL以及如何处理回复 <script type="text/javascript"> //<![CDATA[ $(document).ready(function() { var options = { minChars:3, max:20 }; $("#runnerquery").autocomplete('./index/runnerfilter/format/html',options).result( function(event, data, formatted) { window.location = "./runner/index/id/"+data[1]; } ); .. 我需要进行什么更改才能将其转换为预输入示例? <script type="text/javascript"> //<![CDATA[ $(document).ready(function() { var options = { source:'/index/runnerfilter/format/html', items:5 }; $("#runnerquery").typeahead(options).result( function(event, data, formatted) { window.location = "./runner/index/id/"+data[1]; } …

9
Twitter的typeahead.js建议未设置样式(无边框,透明背景等)
我使用的是twitter的typeahead.js 0.9.3,看来我的建议根本没有样式。 我得到这个: 而不是这样:(取自示例页面) JavaScript启用预输入: $('.search-typeahead').typeahead({ name: 'videos', remote: { url: '/api/v1/internal/videos/typeahead?text=%QUERY' } }); HTML输入元素: <input type="text" value="" id="search_keywords" class="no-clear search-typeahead"/> 补充笔记: 我正在工作的网站具有jQuery 1.10.1,并且未使用twitter引导程序。我没有写过很多CSS,因此我不熟悉它们,我担心会干扰它们,但是似乎该插件添加了自己的样式(没有随附的.css文件),因此从理论上讲它不应该覆盖所有内容?我很困惑为什么我的样式有效,但插件添加的样式却无效,从而导致背景透明,无边框等建议。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.