如何自定义 jquery autocomplete combobox css 以便我可以让它看起来像图片中那样以更改其悬停样式?
我的部分代码是
.ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active,
.ui-autocomplete, .ui-autocomplete:hover,
.ui-menu-item, .ui-menu-item:hover,
.ui-menu-item a, .ui-menu-item a:hover,
.ui-widget-content .ui-state-focus,
.ui-widget-header .ui-state-focus,
.ui-widget-content .ui-state-hover,
.ui-widget-header .ui-state-hover,
.ui-menu .ui-menu-item a.ui-state-focus,
.ui-menu .ui-menu-item a.ui-state-active,
.ui-menu .ui-menu-item a {
background-color: white;
text-wrap: none;
font-weight: normal;
color: black;
}
.custom-combobox-toggle {
position: absolute;
top: 0;
bottom: 0;
margin-left: -1px;
padding: 0;
/* support: IE7 */
*height: 1.7em;
*top: 0.1em;
width: 40px;
color: white;
border: thin;
border-color: blue;
}
.ui-autocomplete {
max-height: 200px;
overflow-y: auto;
/* prevent horizontal scrollbar */
overflow-x: hidden;
/* add padding to account for vertical scrollbar */
position: absolute;
font-style: normal;
}
图片:现有外观
最佳答案
您必须更改 .ui-state-focus
的 CSS。
嗯,这对你有用:
.ui-autocomplete .ui-menu-item {
background:white;
}
.ui-autocomplete .ui-state-focus {
background:rgb(39, 108, 255); //Change blue color to your favourite shade
color:white;
}
关于jquery - 自定义 jquery 自动完成组合框 css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24776493/