JQuery UI implements autocomplete to get a display list function example when getting focus

The instance of this article tells the jQuery UI implementation AutoComplete to get the display list function when the focus is acquired. Share to everyone for reference, as follows:

When doing project, the customer has such a need, and the previously entered content, in a text box, using the list of lists, you can choose In other words, if we use Google search, or Baidu search, enter some keywords, will automatically prompt, this feature is called AutoComplete . Of course, there are plugins in jQuery ui, specific download place, search I will know. The focus is, I am using the list of usage, and the list to be selected will pop up when the text box gets the focus. The traditional is that it must only appear after entering the text. After discover, JQuery Ui AutoComplete can achieve

    jQuery Ui AutoComplete - Categories          .ui-autocpelete-category {Font-weight: bold; padding: .2em .4em; margin: .8em 0 .2em; line-height: 1.5;}   var data = [{label: "Anders", category: "" }, {Label: "Andreas", Category: "}, {Label:" Antal ", Category:"}, {Label: "Annhhx10", Category: "Products"}, {Label: "ANNK K12", Category: "Products"}}}}}}, {Label: "ANNTTOP C13", Category: "Products"}, {Label: "Anders Andersson", category: "people "}, {label:" Andreas Andersson ", category:" people "}, {label:"} johnson ", category:" people "}]; function Dynamicautocomplete () {$ (" # search "). AutoComplete ({ DELAY: 200, AutoCUS: False, Source: Data, MINLENGTH: 0,}). Focus () {$ (this) .autocomplete ("search");});}        a categorized search result. Try type "a" or "n".       The code is derived from the official website example, slightly changed slightly, but it seems to be a bit problem under IE, after selecting an option, this list box does not disappear. Also, there is always, which is relatively depressed. 
Function Dynamicautocomplete () {$ ("# Search"). AutoComplete ({minLength: 0, Source: Data, FOCUS: Function () {Return False;}, SELECT: FUNCTION (Event, UI) {$ this = $ (this); settimeout (Function () {$ this.blur ();}, 1);}}). FOCUS (Function () {$ (this). AutoComplete ("Search"); Return False;});};

Timeout to solve, see a lot of online People say that Return False
can be solved, but I have no test success.
More about jQuery related content, interested readers can view This website: “jQuery page element operation skills summary”, “jQuery common event usage and skill summary”, “jQuery common plugin and usage summary”, “jQuery extension skill summary”, “jQuery selector method summary”

I hope this article will help you jQuery program design.

© Copyright Notice
Just support it if you like
comment Grab the couch

Please log in to comment