简体   繁体   中英

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. 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.

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. 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?

Thanks

Got it to work by changing the width in the 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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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