3
I have a select that brings information from a JS, but this select is forming scroll bar and the options are not many and there is room for more options to be shown but regardless of what I try I’m not being able to make all the data be shown instead of the scroll bar.
My select call in HTML
<div class="row">
<div>
<span>Selecione sua localidade: </span>
<select id="cities" class="empty" name="cities" onclick="selected(this.value)">
<option selected >Selecionar</option>
</select>
</div>
</div>
Here I organize the Select
var $select = $('#cities');
$.each(items, function(index, val) {
var optgroup = $('<optgroup>');
optgroup.attr('label', index);
$.each(val, function(index, val) {
optgroup.append($('<option>', {
text: val.loja,
value: val.idx
}));
});
$select.append(optgroup);
});
This way it reads the JS file and groups in select.
Possibly this is a problem in CSS and not in JS
– Renato Tavares
Renato, I tried several changes in CSS and none reflected on the screen. Unbelievably in IE opens without scroll and with all the options available, only in Chrome and Firefox is occurring this.
– CRAJ
your code seems incomplete, the variable
items
is not defined, try adding an executable code withCtrl + M
in the editor– Pedro Sanção