新聞中心
這篇文章將為大家詳細(xì)講解有關(guān)ajax中怎么提交加載進(jìn)度條,文章內(nèi)容質(zhì)量較高,因此小編分享給大家做個(gè)參考,希望大家閱讀完這篇文章后對(duì)相關(guān)知識(shí)有一定的了解。
在jsp頁面中加入
樣式
復(fù)制代碼 代碼如下:
.progress{z-index: 2000}
.mask{position: fixed;top: 0;right: 0;bottom: 0;left: 0; z-index: 1000; background-color: #2F2F2F}
節(jié)點(diǎn)
復(fù)制代碼 代碼如下:
js
復(fù)制代碼 代碼如下:
var img = $("#progressImgage");
var mask = $("#maskOfProgressImage");
復(fù)制代碼 代碼如下:
$.ajax({
url:url,
type:"post",
dataType:"json",
data:data,
beforeSend:function(xhr){
img.show().css({
"position": "fixed",
"top": "40%",
"left": "45%",
"margin-top": function () { return -1 * img.height() / 2; },
"margin-left": function () { return -1 * img.width() / 2; }
});
mask.show().css("opacity", "0.1");
},
success:function(result){
doSuccess()
},
complete:function(xhr){
img.hide();
mask.hide();
}
});
關(guān)于ajax中怎么提交加載進(jìn)度條就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,可以學(xué)到更多知識(shí)。如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到。
分享題目:ajax中怎么提交加載進(jìn)度條-創(chuàng)新互聯(lián)
URL地址:http://fisionsoft.com.cn/article/dghssh.html