我怎样才能使 jQuery Autocomplete 显示带有图像的结果,而不是 PHP?
我正在实现 jQuery 自动完成并希望显示带有关联图像的结果。每个图像的名称与自动完成字段的预测结果相同。即,如果有人输入“braz”,则会出现“brazil”,旁边会内嵌 brazil.jpg。我在执行此操作时遇到困难。
如果有人能指出我正确的方向,我将不胜感激。顺便说一句,我正在使用 Jorn 的版本。
我也有兴趣使用较小版本的自动完成功能,但只找到了 Drew Wilson 的,根本无法使用它。
I am implementing jQuery Autocomplete and wish to display results with an associated image. Each image has the same name as the predicted result of the autocomplete field. i.e. If someone types "braz" then "brazil" appears with brazil.jpg inline beside it. I'm having trouble implementing this.
If anyone can point me in the right direction I'd appreciate it. By the way, I'm using Jorn's version.
Am also interested in using smaller versions of autocomplete, but have only found Drew Wilson's and couldn't manage to work it at all.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看此演示页面上的
#suggest4
。formatItem
和formatResult
函数用于使结果和项目显示不同。Look at
#suggest4
on this demo page. TheformatItem
andformatResult
functions are used to make the result and the item appear different.