1

I am using Jquery ui 1.11.4 and its selectmenu to display a select list with about 200 items.

<select id="myselect">
    <option>1</option>
    ...
    <option>200</option>
</select>

I would like it show only 40 items plus a scrollbar. I tried the following, but it is not working:

<style>
  .overflow { height: 200px; }
</style>


$( "#myselect" ).selectmenu({}).addClass( "overflow" );

Currently, the menu, when it opens, is a long list showing all items.

How can I make it show 40 items only?

Thanks!

curious1
  • 14,155
  • 37
  • 130
  • 231
  • I found out this method: ul.ui-menu { max-height: 420px !important; } from this SO post: http://stackoverflow.com/questions/11501045/jquery-ui-selectmenu-scrollbar-not-working This method works for me. Shouldn't be a simple solution like $( "#myselect" ).selectmenu({items: 40}) ???? – curious1 Sep 17 '15 at 14:07

0 Answers0