apply size="10"to your choice.
sort of:
<select size="10">
</select>
You have to put some style in the shortcut like border, background image, etc.
Something like that:
<label id='choose' for='options'>Select options</label>
<br clear='all' />
<select id='options' size="10" style='display:none;'>
</select>
then use this jQuery code:
$('#choose').click(function(){
$(this).siblings('select').toggle();
});
Try the following:
$('#choose').click(function (e) {
e.stopPropagation();
$(this).siblings('select').css('width', $(this).outerWidth(true)).toggle();
});
$('#options').change(function (e) {
e.stopPropagation();
var val = this.value || 'Select options';
$(this).siblings('#choose').text(val);
$(this).hide();
});
How did you comment:
1 , , css: , FF, .
:
$('#options').find('option').on({
mouseover: function () {
$('.hover').removeClass('hover');
$(this).addClass('hover');
},
mouseleave: function () {
$(this).removeClass('hover');
}
});