简体   繁体   English

JQuery SumoSelect - 页面上具有不同宽度的多个实例

[英]JQuery SumoSelect - multiple instances on page with different widths

I am using the JQuery SumoSelect plugin but I have 2 combo boxes on my page. 我正在使用JQuery SumoSelect插件,但我的页面上有2个组合框。 One needs to be longer than the other but SumoSelect doesn't take the width of the select element as its width and instead uses the width set in the css file. 一个需要比另一个长,但SumoSelect不会将select元素的宽度作为宽度,而是使用css文件中设置的宽度。

I can change the width of the combo box and it shows correctly but the width of the dropdown selections is still governed by SumoSelect's css. 我可以更改组合框的宽度并正确显示,但下拉选项的宽度仍然由SumoSelect的css控制。 Obviously the dropdown should be the same width as the actual element. 显然,下拉列表应与实际元素的宽度相同。

How can I have one box set to, say 200px and the other set to, say, 400px? 如何设置一个盒子,比如200px,另一个设置为400px?

Thanks 谢谢

Got it to work by changing the width in the sumoselect.css 通过改变sumoselect.css中的宽度来实现它

FROM: 从:

.SumoSelect{width: 200px;}

TO: 至:

.SumoSelect{width: inherit;} 

Then wrapped each instance with the desired width (if necessary): 然后用所需的宽度包装每个实例(如果需要):

<div style="width:100px !important">
.
.
.
</div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM