【问题标题】:Can't scroll on autocomplete?无法滚动自动完成?
【发布时间】:2012-03-12 22:59:27
【问题描述】:

This 是我的代码:

HTML

<input type="textbox" id="txtComune" />
<div id="myOwnMenuComuni" style="position:absolute; top:0; left:0px; height:1px;"></div>  

CSS

.ui-widget-content a 
{
    color: #222222 !important;
    cursor: pointer !important;
    float: left !important;
    width: 100% !important;
    border:1px solid #ffffff;
}  

#myOwnMenuComuni .ui-autocomplete 
{
    width: 200px !important;
    max-height: 150px;
    overflow:auto;
    padding-right:20px;
} 

jQuery

var listaComuni = ["Abbiategrasso","Acireale","Acquaviva Delle","Acqui Terme","Adelfia","Adrano","Adria","Adro","Agnosine"];

$('#txtComune').autocomplete({
    source: listaComuni,        
    appendTo: "#myOwnMenuComuni"
});​

尝试选择输入,插入“a”,然后选择最后一项:这是不可能的。为什么?我该如何解决这个问题?

【问题讨论】:

    标签: jquery css jquery-ui autocomplete


    【解决方案1】:

    如果我取消选中“规范化 CSS”并链接到 jQuery UI CSS,那么它可以正常工作: jsFiddle

    【讨论】:

    • 是的,好的,但我需要设置我自己的自动完成菜单的样式!那么,如何?
    【解决方案2】:

    修复了使用display:block 删除float:left

    还是谢谢你!

    【讨论】:

      猜你喜欢
      • 2014-05-16
      • 2020-01-20
      • 2015-07-15
      • 2018-12-19
      • 2021-05-31
      • 2017-08-28
      • 2012-07-18
      • 1970-01-01
      相关资源
      最近更新 更多