Ext Js弹出进度条
- 提问者网友:疯孩纸
- 2021-08-12 17:27
- 五星知识达人网友:酒者煙囻
- 2021-08-12 18:37
可以这样写 代码如下
xJsonTool.prototype.progress = function(num, msgTitle) {
if(this.progressBar==undefined || this.progressBar==null) {
this.progressBar = document.createElement("DIV");
this.progressBar.id = "prog_contain";
this.css(this.progressBar,
{
"position" : "absolute",
"top" : document.body.clientHeight/3+"px",
"left" : (document.body.clientWidth-414)/2+"px",
"zIndex" : "98",
"width" : "414px",
"height" : "62px"
});
document.body.appendChild(this.progressBar);
var divMsg = document.createElement("DIV");
divMsg.id = "prog_msg";
divMsg.innerHTML = msgTitle;
this.progressBar.appendChild(divMsg);
var divHr = document.createElement("DIV");
divHr.innerHTML = "<hr size=1>";
this.progressBar.appendChild(divHr);
var divLoad = document.createElement("DIV");
divLoad.id = "prog_load";
this.css(divLoad,
{
"width" : "412px",
"height" : "23px",
"padding-top" : "5px"
});
this.progressBar.appendChild(divLoad);
var divLoading = document.createElement("DIV");
divLoading.id = "prog_loading";
this.css(divLoading,
{
"position" : "absolute",
"zIndex" : "99",
"height" : "23px",
"filter" : "progid:DXImageTransform.microsoft.gradient(gradienttype=1,startColorStr=white,endColorStr=#708090)",
"backgroundColor" : "#39867b",
"opacity" : "0.5"
});
divLoad.appendChild(divLoading);
var divLoadtext = document.createElement("DIV");
divLoadtext.id = "prog_loadtext";
this.css(divLoadtext,
{
"position" : "absolute",
"zIndex" : "100",
"width" : "400px",
"lineHeight": "23px",
"textAlign" : "center",
"color" : "#8B4513"
});
divLoadtext.innerHTML = "0%";
divLoad.appendChild(divLoadtext);
var shtml = this.progressBar.innerHTML;
var ifm = document.createElement("iframe")
ifm.frameBorder = "0";
ifm.border = "0";
ifm.marginHeight = "0";
ifm.marginWidth = "0";
ifm.scrolling = "no";
ifm.width = "100%";
ifm.height = "100%";
ifm.name=ifm.uniqueID;
ifm.style.width = this.progressBar.offsetWidth;
ifm.style.height = this.progressBar.offsetHeight;
this.progressBar.innerHTML=""
this.progressBar.appendChild(ifm);
ifm.contentWindow.document.write("<body margin=0 >"+shtml+"</body>");
this.progFrm = ifm;
}
this.progFrm.contentWindow.document.getElementById("prog_loading").style.width = num*4 + "px";
this.progFrm.contentWindow.document.getElementById("prog_loadtext").innerHTML = num + "%";
return this.progressBar;
};