jQuery的自动完成:如何显示GIF动画加载图片 [英] jQuery autocomplete: How to show an animated gif loading image

查看:324
本文介绍了jQuery的自动完成:如何显示GIF动画加载图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用jQuery 自动完成插件使用Ajax相结合。你知不知道我该怎么让进度指标执行AJAX搜索?

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?

这是我目前的code。

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>

该FindUsers URL的内容将返回一个用户列表。

The FindUsers URL returns a user list in the content.

推荐答案

自动完成已经添加了 UI的自动完成加载类(加载的时间),可以用于此...

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屋!

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