【发布时间】:2013-03-03 20:47:18
【问题描述】:
在输入框上使用 jquery 自动完成功能。这是 100% 的工作,但认为样式需要一些工作。
目前,jquery 建议显示在其他输入元素的文本后面。如果我单击选择框下方的 jquery 选项,则会触发选择框,而不是选择自动完成选项。
如何将 jquery 自动完成功能配置在最前面?这是js问题还是css问题?
我尝试禁用另一个输入元素,使用以下代码命名为句点,但它不起作用:
<script type="text/javascript">
$(function(){
$("#customer").autocomplete({
minlength: 5,
source: "get_customers",
open: function(event, ui) { // disable other inputs
$("input#period").attr("disabled", "disabled");
},
close: function(event, ui) { // re-enable other inputs
$("input#period").removeAttr("disabled");
},
messages: {
noResults: '',
results: function() {}
}
});
});
</script>
任何关于让 jquery 列表“ontop”或禁用其他表单工作的建议都将不胜感激。
【问题讨论】:
-
我可以看到它可能与 z-index 问题有关的实时链接...在你的 css 中使用 z-index
标签: jquery css autocomplete