Is it possible to use a size (width) selection field with a uniform (jquery plugin)?

I want to use multiple select boxes with multiple widths with uniform. The problem is what I'm doing

$('#small').uniform({selectClass:'smallSelect'});

$('#big').uniform({selectClass:'bigSelect'});

<select id="small">
<option>test</option>
</select>

<select id="big">
<option>test2</option>
</select>

Only the first applies. ie bigSelect is ignored.

+5
source share
3 answers

You can change the width of each select element by setting a range on it that is generated directly. The code creates a wrapper div with a unique identifier for the uniform-yourid element and the child element with the currently selected parameter. below is css for your specified ids, and you can add.

<style type="text/css">
#uniform-small span
{
    width:100px;
    text-align:center;
}
#uniform-big span
{
    width:200px;
    text-align:center;
}
</style>
+9
source

@evanmcd, , , , selectAutoWidth false, css.

$('select').uniform({selectAutoWidth: false});

css .selector, div, .

+2

uniform.default.css uses image sprite.png for themes.

In this image, the width of the various control is determined. Therefore, you cannot change them as your requirement.

0
source

All Articles