2010-05-21 79 views

回答

7

DEMO:http://so.devilmaycode.it/jquery-ui-autocomplete-load-results-to-a-different-locationdiv/

更新

$("#autocomplete").autocomplete({ 
    open: function(event, ui) { 
     $($('ul.ui-autocomplete').removeAttr('style').hide()).appendTo('div').show(); 
    } 
}); 

然後通過它的類.ui-menu-item

例如訪問單個元素將是

$('.ui-autocomplete li').each(function() { 
if ($(this).text() == 'javascript') 
    $(this).append('<img src="" alt="" />'); 
}); 
+0

然後你可以添加一些東西,如#your-append-container .ui-autocomplete {position:static!important; }這樣它就不會在空中了,它會粘在那個容器裏 – 2013-02-21 10:45:27

+0

@gibberish tnx檢查...我已經更新了鏈接和代碼。 – 2014-03-20 20:51:51

+0

Thx用於更新,幷包含代碼。 +1 – gibberish 2014-03-21 02:27:56