jquery ui内autocomplete中的combobox如何设置下拉层高度

xjgsina 2012-04-06 04:35:16
现在此下拉层高度是自适应,有多少数据就列多长。想怎么设置高度,让多余的数据用滚动跳查看。
...全文
882 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
davidhxy1234 2014-09-02
  • 打赏
  • 举报
回复
感谢3楼的解答,不过滚动条确实难看
kmoving 2013-01-22
  • 打赏
  • 举报
回复
editor:{ type:'combobox', options:{ valueField:'id', textField:'text', panelHeight:"100", data:dataTypes, } 今天我也遇到了这个问题,设置panelHeight,这个属性,就可以了。
DQW 2012-10-31
  • 打赏
  • 举报
回复
今天遇到这个问题了,不知道你用的什么版本,现把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;
}


xjgsina 2012-04-06
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]
可不可以用div把ui包起来,div设高度,有滚动条呢?
[/Quote]
这个没用吧
liuf_fenfangjiemei 2012-04-06
  • 打赏
  • 举报
回复
可不可以用div把ui包起来,div设高度,有滚动条呢?

87,923

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧