jQuery:自动完成图像
我见过用 php 脚本来填充自动完成的方法......但不太理解它。不管怎样,我有一堆名字和相关的照片 URL。我想要将名称作为自动完成字典及其相关图像......有点像 Facebook 搜索。真的不知道从哪里开始。 谢谢!
编辑: 不知道从哪里开始,我的意思是特定于图像..我不需要学习字母表哈哈。我有自动完成名称的文本字段,我只想在名称旁边添加照片,最好是在客户端。
I've seen this approached with a php script to fill the autocomplete..and didn't quite understand it. Anyhoo, I have a bunch of names and associated URLs to photos. I want to have the names as the autocomplete dictionary with their associated images...kinda like the facebook search. Don't really know where to start.
Thanks!
Edit:
By don't know where to start, I mean specific to the images.. I don't need to learn the alphabet lol. I have the textfield autocompleting with names and I just want to add photos beside the names, preferably clientside.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
jqueryui 站点上的这个自动完成示例作为起点可能对您有用。
假设您的姓名和照片 URL 已存储在某个数据库中,如果您使用“源”选项以您喜欢使用的任何语言指向服务器端脚本,jqueryui 自动完成功能应该可以非常顺利地为您工作,它只需要查询您的数据库并返回 JSON。
This autocomplete example on the jqueryui site might be useful for you as a starting point.
Assuming you've got your names and photo URLs in a database somewhere, the jqueryui autocomplete should work for you pretty smoothly if you use the 'source' option to point to a server-side script in whatever language you're comfortable working in, which just has to query your DB and return JSON.