简体   繁体   中英

style problem with jQueryUI Autocomplete widget (using remote datasource)

<input class="ui-autocomplete-input"/> represents the text field to be autocompleted.

<ul>...</ul> contains the list of matching items from the text field input. It is added to the document by remote call as you type.

<ul>...</ul> is added just inside the closing </body> tag. I was expecting the <ul>...</ul> to be placed just after the <input class="ui-autocomplete-input"/> . Because this does not happen, the <ul>...</ul> falls outside of the containing div and the resulting style is broken.

Suggestions? Can I specify where the <ul>...</ul> gets placed in the document? Thanks in advance for your time.

Post your source (so we can see exactly what we're working with here) but basically you need just need to find the parent and then appendTo

$("ul").appendTo($("input.ui-autocomplete-input").parent());

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