JQuery UI自动完成(1.8)滚动

我有配置JQuery-UI的自动完成模块的麻烦。当需要选择的数据量足够大时,需要滚动条。

这是我试过的:

>在jquery-ui-1.8.16.css我已经设置了:

ui.autocomplete {
max-height:100px;
overflow-y:auto;
overflow-x:hidden;
}}

*如ui-documentation示例所示

这是我如何声明和自动填写输入:

$(“#myInput”)。autocomplete({
来源:mySource,
minLength:0,
});

我不知道为什么滚动条不出现,任何帮助将不胜感激。非常感谢你!

解决方法

你应该在这样的页面中重写CSS设置
<style>
.ui-autocomplete {
    max-height: 100px;
    overflow-y: auto;
    /* prevent horizontal scrollbar */
    overflow-x: hidden;
    /* add padding to account for vertical scrollbar */
    padding-right: 20px;
}
/* IE 6 doesn't support max-height
 * we use height instead,but this forces the menu to always be this tall
 */
* html .ui-autocomplete {
    height: 100px;
}
</style>

而不是改变jquery-ui-1.8.16.css中的值

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: &lt;span id=&quot...
jQuery 添加水印 &lt;script src=&quot;../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...