看起来 CSS 不适用于我的 Typeahead。
我正在尝试重现可滚动下拉菜单,如下所示https://twitter.github.io/typeahead.js/examples https://twitter.github.io/typeahead.js/examples
这是我的代码:
JS
var productList = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('PART_NO'),
queryTokenizer: Bloodhound.tokenizers.whitespace,
//Maybe I need a prefetch
// prefetch: '../data/films/post_1960.json',
remote: {
url: 'getProducts/%QUERY',
wildcard: '%QUERY'
}
});
$('#scrollable-dropdown-menu .typeahead').typeahead(null, {
name: 'PARTS',
limit: 10,
display: 'PART_NO',
source: productList
});
CSS
#scrollable-dropdown-menu .tt-dropdown-menu {
max-height: 150px;
overflow-y: auto;
background-color: red;
}
我看不到 .tt-dropdown-menu 在哪里?
Cheers,
Mick
看到这个GitHub问题 https://github.com/twitter/typeahead.js/issues/1301。可滚动下拉列表示例存在问题。
将您的 CSS 更新为:
#scrollable-dropdown-menu .tt-menu {
max-height: 150px;
overflow-y: auto;
background-color: red;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)