我想使用具有多个宽度的多个选择框和 uniform 。问题是我什么时候做
$('#small').uniform({selectClass:'smallSelect'});
$('#big').uniform({selectClass:'bigSelect'});
<select id="small">
<option>test</option>
</select>
<select id="big">
<option>test2</option>
</select>
只有第一个被应用,即 bigSelect 被忽略。
最佳答案
您可以通过定位直接生成的跨度来更改每个选择元素的宽度。该代码创建一个 div 包装器,其唯一 ID 为 uniform-yourid 和具有当前选定选项的子 span 元素。以下是您指定的 id 的 css,您可以添加。
<style type="text/css">
#uniform-small span
{
width:100px;
text-align:center;
}
#uniform-big span
{
width:200px;
text-align:center;
}
</style>
关于javascript - 是否可以使用具有统一(jquery 插件)的不同大小(宽度)的选择框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8677143/