jquery - How to show vertical scroll bar on select box -
i using angular select box ,i need show scroll bar if data more 5 .
<select class="form-control" data-ng-model='projectlistdata.appversion' ng-selected ng-options="v.version v.version v in versionlist | orderby:'-version' " > <option value="" selected="selected" disabled="disabled">choose version</option> </select>
i tried size not working .
size = '5'
please suggest
html:
<select id="versions" class="form-control" data-ng-model='projectlistdata.appversion' ng-selected ng-options="v.version v.version v in versionlist | orderby:'-version' " > <option value="" selected="selected" disabled="disabled">choose version</option> </select>
js:
if($scope.versionlist.length > 5){ //vanilla js dropdown defined var dropdown = document.getelementbyid("versions"); dropdown.style.overflow = "scroll"; //single line document.getelementbyid("versions").style.overflow = "scroll"; //jquery $("#versions").css("overflow", "scroll"); }
Comments
Post a Comment