You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
985 B
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 loadingActive(){
console.log("Loading...");
move();
}
</script>