我正在使用Chosen插件在我的网页上显示五个级联下拉列表。我想在每个选择框中使用不同的颜色,但我似乎无法改变文本的颜色。
<script src="/includes/chosen.jquery.js"></script>
<!--this select shows the options in red-->
<select class="RedColour" id="test1"><option value="1">One</option><option value="2">One</option><option value="1">Two</option><option value="3">Three</option></select>
<!--however this "chosen one" does not-->
<select class="chosen-select RedColour" id="test2"><option value="1">One</option><option value="2">One</option><option value="1">Two</option><option value="3">Three</option></select>
<script type="text/javascript">
var config = {
'.chosen-select': { inherit_select_classes: true },
'.chosen-select-deselect': { allow_single_deselect: true, inherit_select_classes: true },
'.chosen-select-no-single': { disable_search_threshold: 10, inherit_select_classes: true },
'.chosen-select-no-results': { no_results_text: 'Oops, nothing found!' },
'.chosen-select-width': { width: "95%" }
}
for (var selector in config) {
$(selector).chosen(config[selector]);
}
</script>