jQuery 自动完成:如何显示动画 gif 加载图像 [英] jQuery autocomplete: How to show an animated gif loading image
本文介绍了jQuery 自动完成:如何显示动画 gif 加载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将 jQuery AutoComplete 插件与 ajax 结合使用.您知道如何在执行 ajax 搜索时显示进度指示器吗?
这是我当前的代码.
<div><input type="text" id="autocomplete-textbox"/><span class="autocomplete-animation"><img id="ajaxanimation" src="../img/indicator.gif")"/></span>
FindUsers URL 返回内容中的用户列表.
解决方案
autocomplete 已经添加了可用于此的 ui-autocomplete-loading
类(在加载期间)..
.ui-autocomplete-loading { background:url('img/indicator.gif') no-repeat right center }
I'm using the jQuery AutoComplete plugin combined with ajax. Do you know how can I show a progress indicator while the ajax search is performed?
This is my current code.
<script type="text/javascript">
$("#autocomplete-textbox").autocomplete('http://www.example.com/AutoComplete/FindUsers');
</script>
<div>
<input type="text" id="autocomplete-textbox" />
<span class="autocomplete-animation"><img id="ajaxanimation" src="../img/indicator.gif")"/></span>
</div>
The FindUsers URL returns a user list in the content.
解决方案
autocomplete already adds the ui-autocomplete-loading
class (for the duration of the loading) that can be used for this...
.ui-autocomplete-loading { background:url('img/indicator.gif') no-repeat right center }
这篇关于jQuery 自动完成:如何显示动画 gif 加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文