今天遇到这个问题了,不知道你用的什么版本,现把1.9.0的供上 其实官网都有样例 来源:http://jqueryui.com/autocomplete/#maxheight样式加入: .ui-autocomplete { max-height: 100px;//高度值 overflow-y: auto; //超过高度出现滚动条 /* prevent horizontal scrollbar */ overflow-x: hidden; //横向超出隐藏,如果要出现横向滚动,设置为auto即可 } /* 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; }
其实官网都有样例
来源:http://jqueryui.com/autocomplete/#maxheight样式加入:
.ui-autocomplete {
max-height: 100px;//高度值
overflow-y: auto; //超过高度出现滚动条
/* prevent horizontal scrollbar */
overflow-x: hidden; //横向超出隐藏,如果要出现横向滚动,设置为auto即可
}
/* 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;
}
type:'combobox',
options:{
valueField:'id',
textField:'text',
panelHeight:"100",
data:dataTypes,
}
今天我也遇到了这个问题,设置panelHeight,这个属性,就可以了。