简体   繁体   中英

How can I do JQuery UI autocomplete under ul tag?

This is my plugin with autocomplete(you can type C,B,..)

http://kolesnikg.github.io/

I want to do autocomplete just below ul tag(input field). How can i do it?

You could add a listener for the keypress on your input field, and each key concatenate it to a String, with that string filter the list of elements that are going to be displayed. After you filter them for each element left you insert in the inner html of the select an option or list item showing the element.

In JQuery UI there is class ".ui-autocomplete-loading" that control autocomplete content.

so i just add to my css file:

.ui-autocomplete-loading { position: absolute; left: Xpx; top:Xpx;}

and add style to tag UL in html file relative to which i want to place autocomplete:

<ul id="myTags" class="ui-menu tagit-autocomplete" style="position: absolute; z-index: 1;"></ul>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM