我的自动 YUI 自动完成 zindex 已关闭。如何强制自动完成 DIV 到顶部。
下面我使用 YUI 的标准模板:
YAHOO.util.Event.onDOMReady(function(){ YUI().use("autocomplete", "autocomplete-filters", "autocomplete-highlighters", function (Y) { var inputNode = Y.one('#name' ),标签= ['css','css3','douglas crockford','ecmascript','html','html5','java','javascript','json','node.js','pie ', 'yui' ], lastValue = '';
inputNode.plug(Y.Plugin.AutoComplete, {
activateFirstItem: true,
minQueryLength: 0,
queryDelay: 0,
source: tags,
resultHighlighter: 'startsWith',
resultFilters: ['startsWith']
});
// When the input node receives focus, send an empty query to display the full
// list of tag suggestions.
inputNode.on('focus', function () {
inputNode.ac.sendRequest('');
});
// When there are new AutoComplete results, check the length of the result
// list. A length of zero means the value isn't in the list, so reset it to
// the last known good value.
inputNode.ac.on('results', function (e) {
if (e.results.length) {
lastValue = inputNode.ac.get('value');
} else {
inputNode.set('value', lastValue);
}
});
// Update the last known good value after a selection is made.
inputNode.ac.after('select', function (e) {
lastValue = e.result.text;
});
});
});