59 lines
1.1 KiB
Plaintext
59 lines
1.1 KiB
Plaintext
|
|
<div id="simpleProgress">
|
|
<div id="simpleBar"></div>
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
var elem = document.getElementById("simpleBar");
|
|
|
|
var position = 0;
|
|
var rm = true;
|
|
var id;
|
|
|
|
|
|
function frame() {
|
|
|
|
if(rm) {
|
|
if(position>70){
|
|
rm=false;
|
|
position--;
|
|
} else {
|
|
position++;
|
|
}
|
|
} else {
|
|
if(position>0){
|
|
position--;
|
|
} else {
|
|
rm=true;
|
|
position++;
|
|
}
|
|
}
|
|
elem.style.marginLeft = position+"%";
|
|
}
|
|
|
|
function end(){
|
|
clearInterval(id);
|
|
var elemContainer = document.getElementById("simpleProgress");
|
|
//elemContainer.style.display = "none";
|
|
elemContainer.style.visibility = "hidden";
|
|
}
|
|
|
|
function move() {
|
|
var elemContainer = document.getElementById("simpleProgress");
|
|
//elemContainer.style.display = "block";
|
|
elemContainer.style.visibility = "visible";
|
|
id=setInterval(frame, 10);
|
|
}
|
|
|
|
function sendRequest(formName, elem){
|
|
console.log("Send Request");
|
|
elem.disabled=true;
|
|
move();
|
|
let frm=document.getElementById(formName);
|
|
document.getElementById("act").value="submit";
|
|
frm.submit();
|
|
}
|
|
|
|
</script>
|
|
|