select - Display options on top of choice -
i'm using select2 plugin select element. need show select options on select selection set negative margin select options. options showing on select selection did not remain opened. maybe happen because of onkeyup event on select result item. have no clue how resolve problem.
this illustration want:
html:
<select name=""> <option>option 1</option> <option>option 2</option> <option>option 3</option> <option>option 4</option> </select> js:
$(document).ready(function() { $('select').select2({ minimumresultsforsearch: -1 }); }); css:
.select2-drop { margin-top: -26px; } code example: http://jsfiddle.net/quark2014/yc3kt/4/
thanks
the first step though utilize select2 event : select2-selecting
the code below
$(document).ready(function() { $('select').select2({ minimumresultsforsearch: -1 }).on('select2-selecting',function(e){ e.preventdefault(); }); }); jsbin
but still have problem orz..
select positioning show-hide jquery-select2
No comments:
Post a Comment