加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

扩展ajax ,请求等待图片展示

发布时间:2020-12-16 00:20:09 所属栏目:百科 来源:网络整理
导读:script type="text/javascript" $(function () { $.ajax2 = function (options) { var img = $("#progressImgage"); var mask = $("#maskOfProgressImage"); var complete = options.complete; options.complete = function (httpRequest,status) { img.hide


<script type="text/javascript"> $(function () { $.ajax2 = function (options) { var img = $("#progressImgage"); var mask = $("#maskOfProgressImage"); var complete = options.complete; options.complete = function (httpRequest,status) { img.hide(); mask.hide(); if (complete) { complete(httpRequest,status); } }; options.async = false; /* img.show().css({ "position": "fixed","top": "50%","left": "50%","margin-top": function () { return -1 * img.height() / 2; },"margin-left": function () { return -1 * img.width() / 2; } }); */ img.show().animate({ position: "fixed",top: "50%",left: "50%",marginTop:function () { return -1 * img.height() / 2; },marginLeft: function () { return -1 * img.width() / 2; } },3000 ); mask.show().css("opacity","0.1"); $.ajax(options); }; }); </script> $.ajax2({ url: url,data:"contentId="+contentId,success:function(data){ var last_mb20Temp = $(".mb_20:last"); last_mb20Temp.after(data); mbIndex = $(".mb_20").index(last_mb20Temp); } }); <img id="progressImgage" class="progress hide" alt="" src="/${res}/img/images/loading.gif" /> <div id="maskOfProgressImage" class="mask hide"></div>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读