gpt4 book ai didi

jquery 自动完成结果显示在其他输入元素之上

转载 作者:行者123 更新时间:2023-12-01 02:12:08 26 4
gpt4 key购买 nike

在输入框上使用 jquery 自动完成功能。这 100% 有效,但我认为样式需要一些工作。

目前,jquery 建议显示在其他输入元素的文本后面。如果我单击选择框下方的 jquery 选项,则会触发选择框而不是选择自动完成选项。

如何将 jquery 自动完成配置在顶部?这是js问题还是css问题?

我尝试使用以下代码禁用另一个名为 period 的输入元素,但它不起作用:

<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”或禁用其他表单工作的建议将不胜感激。

最佳答案

尝试

.ui-autocomplete{
z-index:50; //Where 50 is just an arbitrary number superior to your form's z-indexes
}

关于jquery 自动完成结果显示在其他输入元素之上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15427300/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com