相关疑难解决方法(0)

Typeahead - 可滚动下拉菜单

看起来CSS不适用于我的Typeahead.我正在尝试重现Scrollable Dropdown菜单,如 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
        });
Run Code Online (Sandbox Code Playgroud)

CSS

 #scrollable-dropdown-menu .tt-dropdown-menu {
            max-height: 150px;
            overflow-y: auto;
            background-color: red;
        }
Run Code Online (Sandbox Code Playgroud)

我看不到.tt-dropdown-menu的位置?

干杯,

米克

typeahead typeahead.js

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

typeahead ×1

typeahead.js ×1