jquery自动完成下拉列表是透明的 [英] jquery autocomplete dropdown is transparent

查看:113
本文介绍了jquery自动完成下拉列表是透明的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的一个文本字段上使用jquery自动完成,并且除了由于某种原因下拉列表是透明的事实外,一切似乎都可以。

I am trying to use jquery autocomplete on one of my textfields, and everything seems to be ok except for the fact that the dropdown is transparent for some reason.

我链接jquery-ui.js和jquery-ui.css,两者都是版本1.11.4。它似乎正在加载值ok,下拉列​​表的透明度似乎是唯一的问题。我的js代码非常简单:

I am linking both jquery-ui.js and jquery-ui.css, both are version 1.11.4. It seems to be loading the values ok, the transparency of the dropdown seems to be the only problem. My js code is as simple as it can get:

$( "#edit_account" ).autocomplete({
source: dataArray
});

这里是它的样子截图:

我环顾四周,但没有发现同样的问题。

I have looked around and have not found the same issue.

谢谢。

推荐答案

上述案例的问题只是透明背景。

The issue with the above case was just the transparent background.

附加到DOM的列表是

<ul class="ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-autocomplete-custom"></ul>

使用CSS

.ui-autocomplete-custom {
    background: #87ceeb;
    z-index: 2;
}

这会为列表添加颜色,而z-index将确保元素位于另一个元素之上。

This would add a color to the list, and z-index would ensure the element lies above another element.

这篇关于jquery自动完成下拉列表是透明的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆