show select options with jquery on demand -
i have hidden selects , want show options when clickin in previous div fakeinput
class
this how i'm trying:
$('body').on('click','.fakeinput',function(){ console.log(true); $(this).next('select').show().click(); }); $('body').on('blur','select',function(){ $(this).hide(); });
but hide/show select item, wont show select's options
what missing here?
-edit-
fiddle: http://jsfiddle.net/qaayd/2/
i'm not sure best solution, when had similar problem gave select
size
attribute made open, , gave position: absolute
"float" above else.
$(this).next('select').attr('size', $(this).next('select').find('option').length) .show();
Comments
Post a Comment