I use chosen in order to make a fun combobox. Everything works fine but I have a question.
I think the option list takes the width given in the visual combobox. All my options are very long and I must make a very large combobox to avoid options going in two lines.
Is it possible to make a little combobox, like 150px, when closed, and a much bigger one when the list is open?
Yes that is possible. This can done in 2 ways:
chzn-drop
in chosen.css file.I prefer 2nd one and here is the code:
HTML:
<select class="chzn-select" data-placeholder="select your options" style="width: 150px">
<option value="">option1</option>
<option value="option1">option2</option>
<option value="option2">option3</option>
</select>
jQuery:
$('.chzn-select').chosen();
$('.chzn-drop').css({"width": "300px"});
Result:
Hope you understood.