如何添加图像到此JQueryUI自动完成插件的结果? [英] How do I add images to results of this JQueryUI autocomplete plugin?

查看:187
本文介绍了如何添加图像到此JQueryUI自动完成插件的结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是插件: http://jqueryui.com/demos/autocomplete/#default



之前,我使用了,它有图像支持,但这是贬值,并导致上面的jqueryui插件。



没有任何演示或示例代码如何使用新插件添加图片。



我想在结果旁边添加图片,如Facebook的朋友风格。

解决方案

自定义数据和显示 a> demo演示如何显示:

  $(selector).autocomplete({/ * ... * /})
.data('autocomplete')._ renderItem = function(ul,item){
/ *这里的自定义渲染代码* /
}

点击自定义数据演示页面上的查看源代码链接, >

This is the plugin: http://jqueryui.com/demos/autocomplete/#default

Before, I used 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.

这篇关于如何添加图像到此JQueryUI自动完成插件的结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆