admin管理员组文章数量:1252714
I have some trouble creating a 100% width select box with SelectBoxIt.js
Even when setting the CSS width to 100%, the select box will not fill 100% of the container element.
CSS:
.test1, .test2, .test2 .selectboxit, .test2 .selectboxit-options {
width: 100%;
}
HTML:
<select name="test2" class="test2">
<option value="SelectBoxIt is:">SelectBoxIt is:</option>
<option value="a jQuery Plugin">a jQuery Plugin</option>
<option value="a Select Box Replacement">a Select Box Replacement</option>
<option value="a Stateful UI Widget">a Stateful UI Widget</option>
</select>
I have some trouble creating a 100% width select box with SelectBoxIt.js
Even when setting the CSS width to 100%, the select box will not fill 100% of the container element.
CSS:
.test1, .test2, .test2 .selectboxit, .test2 .selectboxit-options {
width: 100%;
}
HTML:
<select name="test2" class="test2">
<option value="SelectBoxIt is:">SelectBoxIt is:</option>
<option value="a jQuery Plugin">a jQuery Plugin</option>
<option value="a Select Box Replacement">a Select Box Replacement</option>
<option value="a Stateful UI Widget">a Stateful UI Widget</option>
</select>
Share
Improve this question
edited Aug 16, 2013 at 12:06
groodt
asked Aug 16, 2013 at 8:53
groodtgroodt
1,99315 silver badges26 bronze badges
2 Answers
Reset to default 10js
$(".mySelect").selectBoxIt({ autoWidth: false });
and then css
.selectboxit-container {
width: 100%;
}
.selectboxit-container .selectboxit {
width: 100%;
}
Greg Franko helped me solve the issue.
You can see the solution in JSBin. http://jsbin./udapic/1/edit
Basically, you need to disable autoWidth like so:
$(".test2").selectBoxIt({ autoWidth: false, copyClasses: "container" });
And then set the width to 100% in your CSS:
.test1, .test2, .test2 .selectboxit, .test2 .selectboxit-options {
width: 100%;
}
本文标签: javascriptHow to create a 100 width select with SelectBoxItjsStack Overflow
版权声明:本文标题:javascript - How to create a 100% width select with SelectBoxIt.js - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740312839a2259740.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论