是否有可能通过jQuery UI来限制selectmenu小部件的高度? [英] Is it possible to limit the height of a selectmenu widget with jQuery UI?

查看:302
本文介绍了是否有可能通过jQuery UI来限制selectmenu小部件的高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图通过设置源选择元素的大小属性来达到这个目的,但它是被忽略了。这个小部件似乎没有任何高度设置选项。是否有可能?

I've been trying to do this by setting the size attribute of the source select element, but it's being ignored. There doesn't seem to any height setting option for the widget. Is it possible?

该小部件目前正在隐藏溢出的div对话框中工作,所以下拉菜单(总是26个项目)就会从div中消失。

The widget is currently working inside a div dialog that has overflow hidden, so the drop-down (26 items, always) just disappears off the div.

推荐答案

在jQuery UI Selectmenu中没有大小类似的选项(又名显示不仅仅是一个按钮,而是一个选择窗格) 。但可以通过CSS更改生成的按钮的高度。

There is no size similar option in jQuery UI Selectmenu (aka show more than just a button but a select "pane"). But it's possible to change the height of the generated button by CSS.

另一个想法是改变@Michael提出的渲染机制。

Another idea would be changing the rendering mechanism like @Michael proposed.

演示提琴将很有用。当您的实际问题是div的溢出时,您可以尝试使用appendTo选项将菜单添加到另一个元素,请参阅 http://api.jqueryui.com/selectmenu/#option-appendTo

A demo fiddle would be useful. When your actual issue is the overflow of the div you could try to add the menu to another element by using the appendTo option, see http://api.jqueryui.com/selectmenu/#option-appendTo

这篇关于是否有可能通过jQuery UI来限制selectmenu小部件的高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆