How do I add images to results of this JQueryUI autocomplete plugin?
This is the plugin: http://jqueryui.com/demos/autocomplete/#default
Before, I use开发者_JAVA百科d this, and it had image support, but this was depreciated and resulted into the jqueryui plugin above.
There aren't any demos or sample code on how to add images using the new plugin.
I want to add images next to the result, like Facebook friends-style.
The Custom Data and Display demo shows you how:
$(selector).autocomplete({ /* ... */ })
.data('autocomplete')._renderItem = function(ul, item) {
/* Custom rendering code here */
};
Hit the "view source" link on the Custom Data demo page for a full example.
精彩评论