Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the 'scroll' and 'max' options in Autocomplete

I need help with aucomplete of the jquery.

jQuery("#PeopleName").autocomplete(                                    {source:["name1","name2","..."],                                     minLength:2,                                     max:10,                                     scroll:true}); 

The 'scroll' and 'max' are not working.
I am use jquery-ui-1.8.18.custom.min.js. What is wrong with this code?

like image 955
fmassica Avatar asked Mar 06 '12 19:03

fmassica


1 Answers

I managed to solve this problem. I found the code in jqueryUI

<style>        .ui-autocomplete {             max-height: 200px;             overflow-y: auto;             /* prevent horizontal scrollbar */             overflow-x: hidden;             /* add padding to account for vertical scrollbar */             padding-right: 20px;         }  </style>  <script> jQuery("#PeopleName").autocomplete({                                    source:["name1","name2","..."],                                    minLength:2                                    });  </script> 

This is working.

like image 89
fmassica Avatar answered Oct 06 '22 18:10

fmassica