<pre>
1、用到的js
function topLoading() {
if(document.getElementByIdx_x("topLoadingDiv")==null ||document.getElementByIdx_x("topLoadingDiv")==undefined) {
document.write("<div id='topLoadingDiv'class='top_loading'><img border='0'src='../images/loading.gif'/></div>");
}
document.getElementByIdx_x("topLoadingDiv").className="top_loading";
document.getElementByIdx_x("topLoadingDiv").style.left=(document.documentElement.clientWidth-32)/2+"px";
document.getElementByIdx_x("topLoadingDiv").style.top=(document.documentElement.clientHeight-32)/2+"px";
}
function topLoaded() {
if(document.getElementByIdx_x("topLoadingDiv")!='null'&&document.getElementByIdx_x("topLoadingDiv")!=undefined) {
document.getElementByIdx_x("topLoadingDiv").className="top_loaded";
}
}
2、用到的css
div.top_loading{background:url('../images/loading.gif')no-repeat;width:32px;height:32px;top:100px;left:100px;background-color:transparent;position:fixed;z-index:10000;}
div.top_loaded{width:1px;height:1px;background-color:transparent;display:none;}
3、用到的html
// 调用ajax之前
topLoading();
$.getJSON(url,null,function(data) {
obj.disabled=false;
if (data == "error") {
alert(opeContent+"失败!");
} else if (data == "succ"){
// 2、根据返回结果(成功或者失败),重写load该流程对应的所有组件
alert(opeContent+"成功!");
reloadListDetail(obj);
} else {
alert(data);
reloadListDetail(obj);
}
// ajax返回之后
topLoaded();
});
4、用到的图片:随便从网上下一个你所喜欢的即可。
</pre>