JQuery UI Autocomplete (1.8) scroll

前端 未结 1 939
南方客
南方客 2021-02-04 00:30

i\'m having troubles configuring the autocomplete module of JQuery-UI. I need that when the amount of data to select is big enough an scroll bar appears.

This is what i

相关标签:
1条回答
  • 2021-02-04 00:57

    You should override the css setting it in the page like this

    <style>
    .ui-autocomplete {
        max-height: 100px;
        overflow-y: auto;
        /* prevent horizontal scrollbar */
        overflow-x: hidden;
        /* add padding to account for vertical scrollbar */
        padding-right: 20px;
    }
    /* IE 6 doesn't support max-height
     * we use height instead, but this forces the menu to always be this tall
     */
    * html .ui-autocomplete {
        height: 100px;
    }
    </style>
    

    instead of changing values in jquery-ui-1.8.16.css

    0 讨论(0)
提交回复
热议问题