javascript - ajaxfileupload插件 ajaxstart
PHP中文网
PHP中文网 2017-04-10 17:04:43
0
1
347
  1. 描述你的问题
    使用插件上传图片时,显示和隐藏的gif图片有问题。

上传第一张图时

上传第二张图时


上传第三张图时

  1. 贴上相关代码

<script type="text/javascript" src="/js/ajaxfileupload.js"></script>
<script type="text/javascript">

function ajaxFileUpload(a){
    if(a == 0){
        $$("#loading_upload").ajaxStart(function(){
            $$(this).show();
        }).ajaxComplete(function(){
            $$(this).hide();
        });
    }else{
        $$("#loading_upload"+a).ajaxStart(function(){
            $$(this).show();
        }).ajaxComplete(function(){
            $$(this).hide();
        });
    }

3.loading_upload+a就是对应每个位置的id号,为什么我再上传第二张图片的时候,第一张图片的gif也显示了出来,上传第三张图片时,一二张的gif也显示了出来?该如何修改?

PHP中文网
PHP中文网

认证高级PHP讲师

全部回复(1)
Ty80

Whenever an Ajax request completes, jQuery triggers the ajaxComplete event. Any and all handlers that have been registered with the .ajaxComplete() method are executed at this time.

via https://api.jquery.com/ajaxComplete/

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!